Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
swigfaiss.cpp
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #endif
15 
16 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
17 
18 
19 #ifdef __cplusplus
20 /* SwigValueWrapper is described in swig.swg */
21 template<typename T> class SwigValueWrapper {
22  struct SwigMovePointer {
23  T *ptr;
24  SwigMovePointer(T *p) : ptr(p) { }
25  ~SwigMovePointer() { delete ptr; }
26  SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
27  } pointer;
28  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
29  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
30 public:
31  SwigValueWrapper() : pointer(0) { }
32  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
33  operator T&() const { return *pointer.ptr; }
34  T *operator&() { return pointer.ptr; }
35 };
36 
37 template <typename T> T SwigValueInit() {
38  return T();
39 }
40 #endif
41 
42 /* -----------------------------------------------------------------------------
43  * This section contains generic SWIG labels for method/variable
44  * declarations/attributes, and other compiler dependent labels.
45  * ----------------------------------------------------------------------------- */
46 
47 /* template workaround for compilers that cannot correctly implement the C++ standard */
48 #ifndef SWIGTEMPLATEDISAMBIGUATOR
49 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
50 # define SWIGTEMPLATEDISAMBIGUATOR template
51 # elif defined(__HP_aCC)
52 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
53 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
54 # define SWIGTEMPLATEDISAMBIGUATOR template
55 # else
56 # define SWIGTEMPLATEDISAMBIGUATOR
57 # endif
58 #endif
59 
60 /* inline attribute */
61 #ifndef SWIGINLINE
62 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
63 # define SWIGINLINE inline
64 # else
65 # define SWIGINLINE
66 # endif
67 #endif
68 
69 /* attribute recognised by some compilers to avoid 'unused' warnings */
70 #ifndef SWIGUNUSED
71 # if defined(__GNUC__)
72 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
73 # define SWIGUNUSED __attribute__ ((__unused__))
74 # else
75 # define SWIGUNUSED
76 # endif
77 # elif defined(__ICC)
78 # define SWIGUNUSED __attribute__ ((__unused__))
79 # else
80 # define SWIGUNUSED
81 # endif
82 #endif
83 
84 #ifndef SWIG_MSC_UNSUPPRESS_4505
85 # if defined(_MSC_VER)
86 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
87 # endif
88 #endif
89 
90 #ifndef SWIGUNUSEDPARM
91 # ifdef __cplusplus
92 # define SWIGUNUSEDPARM(p)
93 # else
94 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
95 # endif
96 #endif
97 
98 /* internal SWIG method */
99 #ifndef SWIGINTERN
100 # define SWIGINTERN static SWIGUNUSED
101 #endif
102 
103 /* internal inline SWIG method */
104 #ifndef SWIGINTERNINLINE
105 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
106 #endif
107 
108 /* exporting methods */
109 #if defined(__GNUC__)
110 # if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
111 # ifndef GCC_HASCLASSVISIBILITY
112 # define GCC_HASCLASSVISIBILITY
113 # endif
114 # endif
115 #endif
116 
117 #ifndef SWIGEXPORT
118 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
119 # if defined(STATIC_LINKED)
120 # define SWIGEXPORT
121 # else
122 # define SWIGEXPORT __declspec(dllexport)
123 # endif
124 # else
125 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
126 # define SWIGEXPORT __attribute__ ((visibility("default")))
127 # else
128 # define SWIGEXPORT
129 # endif
130 # endif
131 #endif
132 
133 /* calling conventions for Windows */
134 #ifndef SWIGSTDCALL
135 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
136 # define SWIGSTDCALL __stdcall
137 # else
138 # define SWIGSTDCALL
139 # endif
140 #endif
141 
142 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
143 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
144 # define _CRT_SECURE_NO_DEPRECATE
145 #endif
146 
147 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
148 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
149 # define _SCL_SECURE_NO_DEPRECATE
150 #endif
151 
152 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
153 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
154 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
155 #endif
156 
157 /* Intel's compiler complains if a variable which was never initialised is
158  * cast to void, which is a common idiom which we use to indicate that we
159  * are aware a variable isn't used. So we just silence that warning.
160  * See: https://github.com/swig/swig/issues/192 for more discussion.
161  */
162 #ifdef __INTEL_COMPILER
163 # pragma warning disable 592
164 #endif
165 
166 
167 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
168 /* Use debug wrappers with the Python release dll */
169 # undef _DEBUG
170 # include <Python.h>
171 # define _DEBUG
172 #else
173 # include <Python.h>
174 #endif
175 
176 /* -----------------------------------------------------------------------------
177  * swigrun.swg
178  *
179  * This file contains generic C API SWIG runtime support for pointer
180  * type checking.
181  * ----------------------------------------------------------------------------- */
182 
183 /* This should only be incremented when either the layout of swig_type_info changes,
184  or for whatever reason, the runtime changes incompatibly */
185 #define SWIG_RUNTIME_VERSION "4"
186 
187 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
188 #ifdef SWIG_TYPE_TABLE
189 # define SWIG_QUOTE_STRING(x) #x
190 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
191 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
192 #else
193 # define SWIG_TYPE_TABLE_NAME
194 #endif
195 
196 /*
197  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
198  creating a static or dynamic library from the SWIG runtime code.
199  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
200 
201  But only do this if strictly necessary, ie, if you have problems
202  with your compiler or suchlike.
203 */
204 
205 #ifndef SWIGRUNTIME
206 # define SWIGRUNTIME SWIGINTERN
207 #endif
208 
209 #ifndef SWIGRUNTIMEINLINE
210 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
211 #endif
212 
213 /* Generic buffer size */
214 #ifndef SWIG_BUFFER_SIZE
215 # define SWIG_BUFFER_SIZE 1024
216 #endif
217 
218 /* Flags for pointer conversions */
219 #define SWIG_POINTER_DISOWN 0x1
220 #define SWIG_CAST_NEW_MEMORY 0x2
221 
222 /* Flags for new pointer objects */
223 #define SWIG_POINTER_OWN 0x1
224 
225 
226 /*
227  Flags/methods for returning states.
228 
229  The SWIG conversion methods, as ConvertPtr, return an integer
230  that tells if the conversion was successful or not. And if not,
231  an error code can be returned (see swigerrors.swg for the codes).
232 
233  Use the following macros/flags to set or process the returning
234  states.
235 
236  In old versions of SWIG, code such as the following was usually written:
237 
238  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
239  // success code
240  } else {
241  //fail code
242  }
243 
244  Now you can be more explicit:
245 
246  int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
247  if (SWIG_IsOK(res)) {
248  // success code
249  } else {
250  // fail code
251  }
252 
253  which is the same really, but now you can also do
254 
255  Type *ptr;
256  int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
257  if (SWIG_IsOK(res)) {
258  // success code
259  if (SWIG_IsNewObj(res) {
260  ...
261  delete *ptr;
262  } else {
263  ...
264  }
265  } else {
266  // fail code
267  }
268 
269  I.e., now SWIG_ConvertPtr can return new objects and you can
270  identify the case and take care of the deallocation. Of course that
271  also requires SWIG_ConvertPtr to return new result values, such as
272 
273  int SWIG_ConvertPtr(obj, ptr,...) {
274  if (<obj is ok>) {
275  if (<need new object>) {
276  *ptr = <ptr to new allocated object>;
277  return SWIG_NEWOBJ;
278  } else {
279  *ptr = <ptr to old object>;
280  return SWIG_OLDOBJ;
281  }
282  } else {
283  return SWIG_BADOBJ;
284  }
285  }
286 
287  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
288  more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
289  SWIG errors code.
290 
291  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
292  allows to return the 'cast rank', for example, if you have this
293 
294  int food(double)
295  int fooi(int);
296 
297  and you call
298 
299  food(1) // cast rank '1' (1 -> 1.0)
300  fooi(1) // cast rank '0'
301 
302  just use the SWIG_AddCast()/SWIG_CheckState()
303 */
304 
305 #define SWIG_OK (0)
306 #define SWIG_ERROR (-1)
307 #define SWIG_IsOK(r) (r >= 0)
308 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
309 
310 /* The CastRankLimit says how many bits are used for the cast rank */
311 #define SWIG_CASTRANKLIMIT (1 << 8)
312 /* The NewMask denotes the object was created (using new/malloc) */
313 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
314 /* The TmpMask is for in/out typemaps that use temporal objects */
315 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
316 /* Simple returning values */
317 #define SWIG_BADOBJ (SWIG_ERROR)
318 #define SWIG_OLDOBJ (SWIG_OK)
319 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
320 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
321 /* Check, add and del mask methods */
322 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
323 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
324 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
325 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
326 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
327 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
328 
329 /* Cast-Rank Mode */
330 #if defined(SWIG_CASTRANK_MODE)
331 # ifndef SWIG_TypeRank
332 # define SWIG_TypeRank unsigned long
333 # endif
334 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
335 # define SWIG_MAXCASTRANK (2)
336 # endif
337 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
338 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
339 SWIGINTERNINLINE int SWIG_AddCast(int r) {
340  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
341 }
342 SWIGINTERNINLINE int SWIG_CheckState(int r) {
343  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
344 }
345 #else /* no cast-rank mode */
346 # define SWIG_AddCast(r) (r)
347 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
348 #endif
349 
350 
351 #include <string.h>
352 
353 #ifdef __cplusplus
354 extern "C" {
355 #endif
356 
357 typedef void *(*swig_converter_func)(void *, int *);
358 typedef struct swig_type_info *(*swig_dycast_func)(void **);
359 
360 /* Structure to store information on one type */
361 typedef struct swig_type_info {
362  const char *name; /* mangled name of this type */
363  const char *str; /* human readable name of this type */
364  swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
365  struct swig_cast_info *cast; /* linked list of types that can cast into this type */
366  void *clientdata; /* language specific type data */
367  int owndata; /* flag if the structure owns the clientdata */
369 
370 /* Structure to store a type and conversion function used for casting */
371 typedef struct swig_cast_info {
372  swig_type_info *type; /* pointer to type that is equivalent to this type */
373  swig_converter_func converter; /* function to cast the void pointers */
374  struct swig_cast_info *next; /* pointer to next cast in linked list */
375  struct swig_cast_info *prev; /* pointer to the previous cast */
377 
378 /* Structure used to store module information
379  * Each module generates one structure like this, and the runtime collects
380  * all of these structures and stores them in a circularly linked list.*/
381 typedef struct swig_module_info {
382  swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
383  size_t size; /* Number of types in this module */
384  struct swig_module_info *next; /* Pointer to next element in circularly linked list */
385  swig_type_info **type_initial; /* Array of initially generated type structures */
386  swig_cast_info **cast_initial; /* Array of initially generated casting structures */
387  void *clientdata; /* Language specific module data */
389 
390 /*
391  Compare two type names skipping the space characters, therefore
392  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
393 
394  Return 0 when the two name types are equivalent, as in
395  strncmp, but skipping ' '.
396 */
397 SWIGRUNTIME int
398 SWIG_TypeNameComp(const char *f1, const char *l1,
399  const char *f2, const char *l2) {
400  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
401  while ((*f1 == ' ') && (f1 != l1)) ++f1;
402  while ((*f2 == ' ') && (f2 != l2)) ++f2;
403  if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
404  }
405  return (int)((l1 - f1) - (l2 - f2));
406 }
407 
408 /*
409  Check type equivalence in a name list like <name1>|<name2>|...
410  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
411 */
412 SWIGRUNTIME int
413 SWIG_TypeCmp(const char *nb, const char *tb) {
414  int equiv = 1;
415  const char* te = tb + strlen(tb);
416  const char* ne = nb;
417  while (equiv != 0 && *ne) {
418  for (nb = ne; *ne; ++ne) {
419  if (*ne == '|') break;
420  }
421  equiv = SWIG_TypeNameComp(nb, ne, tb, te);
422  if (*ne) ++ne;
423  }
424  return equiv;
425 }
426 
427 /*
428  Check type equivalence in a name list like <name1>|<name2>|...
429  Return 0 if not equal, 1 if equal
430 */
431 SWIGRUNTIME int
432 SWIG_TypeEquiv(const char *nb, const char *tb) {
433  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
434 }
435 
436 /*
437  Check the typename
438 */
439 SWIGRUNTIME swig_cast_info *
440 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
441  if (ty) {
442  swig_cast_info *iter = ty->cast;
443  while (iter) {
444  if (strcmp(iter->type->name, c) == 0) {
445  if (iter == ty->cast)
446  return iter;
447  /* Move iter to the top of the linked list */
448  iter->prev->next = iter->next;
449  if (iter->next)
450  iter->next->prev = iter->prev;
451  iter->next = ty->cast;
452  iter->prev = 0;
453  if (ty->cast) ty->cast->prev = iter;
454  ty->cast = iter;
455  return iter;
456  }
457  iter = iter->next;
458  }
459  }
460  return 0;
461 }
462 
463 /*
464  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
465 */
466 SWIGRUNTIME swig_cast_info *
467 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
468  if (ty) {
469  swig_cast_info *iter = ty->cast;
470  while (iter) {
471  if (iter->type == from) {
472  if (iter == ty->cast)
473  return iter;
474  /* Move iter to the top of the linked list */
475  iter->prev->next = iter->next;
476  if (iter->next)
477  iter->next->prev = iter->prev;
478  iter->next = ty->cast;
479  iter->prev = 0;
480  if (ty->cast) ty->cast->prev = iter;
481  ty->cast = iter;
482  return iter;
483  }
484  iter = iter->next;
485  }
486  }
487  return 0;
488 }
489 
490 /*
491  Cast a pointer up an inheritance hierarchy
492 */
493 SWIGRUNTIMEINLINE void *
494 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
495  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
496 }
497 
498 /*
499  Dynamic pointer casting. Down an inheritance hierarchy
500 */
501 SWIGRUNTIME swig_type_info *
502 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
503  swig_type_info *lastty = ty;
504  if (!ty || !ty->dcast) return ty;
505  while (ty && (ty->dcast)) {
506  ty = (*ty->dcast)(ptr);
507  if (ty) lastty = ty;
508  }
509  return lastty;
510 }
511 
512 /*
513  Return the name associated with this type
514 */
515 SWIGRUNTIMEINLINE const char *
516 SWIG_TypeName(const swig_type_info *ty) {
517  return ty->name;
518 }
519 
520 /*
521  Return the pretty name associated with this type,
522  that is an unmangled type name in a form presentable to the user.
523 */
524 SWIGRUNTIME const char *
525 SWIG_TypePrettyName(const swig_type_info *type) {
526  /* The "str" field contains the equivalent pretty names of the
527  type, separated by vertical-bar characters. We choose
528  to print the last name, as it is often (?) the most
529  specific. */
530  if (!type) return NULL;
531  if (type->str != NULL) {
532  const char *last_name = type->str;
533  const char *s;
534  for (s = type->str; *s; s++)
535  if (*s == '|') last_name = s+1;
536  return last_name;
537  }
538  else
539  return type->name;
540 }
541 
542 /*
543  Set the clientdata field for a type
544 */
545 SWIGRUNTIME void
546 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
547  swig_cast_info *cast = ti->cast;
548  /* if (ti->clientdata == clientdata) return; */
549  ti->clientdata = clientdata;
550 
551  while (cast) {
552  if (!cast->converter) {
553  swig_type_info *tc = cast->type;
554  if (!tc->clientdata) {
555  SWIG_TypeClientData(tc, clientdata);
556  }
557  }
558  cast = cast->next;
559  }
560 }
561 SWIGRUNTIME void
562 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
563  SWIG_TypeClientData(ti, clientdata);
564  ti->owndata = 1;
565 }
566 
567 /*
568  Search for a swig_type_info structure only by mangled name
569  Search is a O(log #types)
570 
571  We start searching at module start, and finish searching when start == end.
572  Note: if start == end at the beginning of the function, we go all the way around
573  the circular list.
574 */
575 SWIGRUNTIME swig_type_info *
576 SWIG_MangledTypeQueryModule(swig_module_info *start,
577  swig_module_info *end,
578  const char *name) {
579  swig_module_info *iter = start;
580  do {
581  if (iter->size) {
582  size_t l = 0;
583  size_t r = iter->size - 1;
584  do {
585  /* since l+r >= 0, we can (>> 1) instead (/ 2) */
586  size_t i = (l + r) >> 1;
587  const char *iname = iter->types[i]->name;
588  if (iname) {
589  int compare = strcmp(name, iname);
590  if (compare == 0) {
591  return iter->types[i];
592  } else if (compare < 0) {
593  if (i) {
594  r = i - 1;
595  } else {
596  break;
597  }
598  } else if (compare > 0) {
599  l = i + 1;
600  }
601  } else {
602  break; /* should never happen */
603  }
604  } while (l <= r);
605  }
606  iter = iter->next;
607  } while (iter != end);
608  return 0;
609 }
610 
611 /*
612  Search for a swig_type_info structure for either a mangled name or a human readable name.
613  It first searches the mangled names of the types, which is a O(log #types)
614  If a type is not found it then searches the human readable names, which is O(#types).
615 
616  We start searching at module start, and finish searching when start == end.
617  Note: if start == end at the beginning of the function, we go all the way around
618  the circular list.
619 */
620 SWIGRUNTIME swig_type_info *
621 SWIG_TypeQueryModule(swig_module_info *start,
622  swig_module_info *end,
623  const char *name) {
624  /* STEP 1: Search the name field using binary search */
625  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
626  if (ret) {
627  return ret;
628  } else {
629  /* STEP 2: If the type hasn't been found, do a complete search
630  of the str field (the human readable name) */
631  swig_module_info *iter = start;
632  do {
633  size_t i = 0;
634  for (; i < iter->size; ++i) {
635  if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
636  return iter->types[i];
637  }
638  iter = iter->next;
639  } while (iter != end);
640  }
641 
642  /* neither found a match */
643  return 0;
644 }
645 
646 /*
647  Pack binary data into a string
648 */
649 SWIGRUNTIME char *
650 SWIG_PackData(char *c, void *ptr, size_t sz) {
651  static const char hex[17] = "0123456789abcdef";
652  const unsigned char *u = (unsigned char *) ptr;
653  const unsigned char *eu = u + sz;
654  for (; u != eu; ++u) {
655  unsigned char uu = *u;
656  *(c++) = hex[(uu & 0xf0) >> 4];
657  *(c++) = hex[uu & 0xf];
658  }
659  return c;
660 }
661 
662 /*
663  Unpack binary data from a string
664 */
665 SWIGRUNTIME const char *
666 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
667  unsigned char *u = (unsigned char *) ptr;
668  const unsigned char *eu = u + sz;
669  for (; u != eu; ++u) {
670  char d = *(c++);
671  unsigned char uu;
672  if ((d >= '0') && (d <= '9'))
673  uu = (unsigned char)((d - '0') << 4);
674  else if ((d >= 'a') && (d <= 'f'))
675  uu = (unsigned char)((d - ('a'-10)) << 4);
676  else
677  return (char *) 0;
678  d = *(c++);
679  if ((d >= '0') && (d <= '9'))
680  uu |= (unsigned char)(d - '0');
681  else if ((d >= 'a') && (d <= 'f'))
682  uu |= (unsigned char)(d - ('a'-10));
683  else
684  return (char *) 0;
685  *u = uu;
686  }
687  return c;
688 }
689 
690 /*
691  Pack 'void *' into a string buffer.
692 */
693 SWIGRUNTIME char *
694 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
695  char *r = buff;
696  if ((2*sizeof(void *) + 2) > bsz) return 0;
697  *(r++) = '_';
698  r = SWIG_PackData(r,&ptr,sizeof(void *));
699  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
700  strcpy(r,name);
701  return buff;
702 }
703 
704 SWIGRUNTIME const char *
705 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
706  if (*c != '_') {
707  if (strcmp(c,"NULL") == 0) {
708  *ptr = (void *) 0;
709  return name;
710  } else {
711  return 0;
712  }
713  }
714  return SWIG_UnpackData(++c,ptr,sizeof(void *));
715 }
716 
717 SWIGRUNTIME char *
718 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
719  char *r = buff;
720  size_t lname = (name ? strlen(name) : 0);
721  if ((2*sz + 2 + lname) > bsz) return 0;
722  *(r++) = '_';
723  r = SWIG_PackData(r,ptr,sz);
724  if (lname) {
725  strncpy(r,name,lname+1);
726  } else {
727  *r = 0;
728  }
729  return buff;
730 }
731 
732 SWIGRUNTIME const char *
733 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
734  if (*c != '_') {
735  if (strcmp(c,"NULL") == 0) {
736  memset(ptr,0,sz);
737  return name;
738  } else {
739  return 0;
740  }
741  }
742  return SWIG_UnpackData(++c,ptr,sz);
743 }
744 
745 #ifdef __cplusplus
746 }
747 #endif
748 
749 /* Errors in SWIG */
750 #define SWIG_UnknownError -1
751 #define SWIG_IOError -2
752 #define SWIG_RuntimeError -3
753 #define SWIG_IndexError -4
754 #define SWIG_TypeError -5
755 #define SWIG_DivisionByZero -6
756 #define SWIG_OverflowError -7
757 #define SWIG_SyntaxError -8
758 #define SWIG_ValueError -9
759 #define SWIG_SystemError -10
760 #define SWIG_AttributeError -11
761 #define SWIG_MemoryError -12
762 #define SWIG_NullReferenceError -13
763 
764 
765 
766 /* Compatibility macros for Python 3 */
767 #if PY_VERSION_HEX >= 0x03000000
768 
769 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
770 #define PyInt_Check(x) PyLong_Check(x)
771 #define PyInt_AsLong(x) PyLong_AsLong(x)
772 #define PyInt_FromLong(x) PyLong_FromLong(x)
773 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
774 #define PyString_Check(name) PyBytes_Check(name)
775 #define PyString_FromString(x) PyUnicode_FromString(x)
776 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
777 #define PyString_AsString(str) PyBytes_AsString(str)
778 #define PyString_Size(str) PyBytes_Size(str)
779 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
780 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
781 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
782 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
783 
784 #endif
785 
786 #ifndef Py_TYPE
787 # define Py_TYPE(op) ((op)->ob_type)
788 #endif
789 
790 /* SWIG APIs for compatibility of both Python 2 & 3 */
791 
792 #if PY_VERSION_HEX >= 0x03000000
793 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
794 #else
795 # define SWIG_Python_str_FromFormat PyString_FromFormat
796 #endif
797 
798 
799 /* Warning: This function will allocate a new string in Python 3,
800  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
801  */
802 SWIGINTERN char*
803 SWIG_Python_str_AsChar(PyObject *str)
804 {
805 #if PY_VERSION_HEX >= 0x03000000
806  char *cstr;
807  char *newstr;
808  Py_ssize_t len;
809  str = PyUnicode_AsUTF8String(str);
810  PyBytes_AsStringAndSize(str, &cstr, &len);
811  newstr = (char *) malloc(len+1);
812  memcpy(newstr, cstr, len+1);
813  Py_XDECREF(str);
814  return newstr;
815 #else
816  return PyString_AsString(str);
817 #endif
818 }
819 
820 #if PY_VERSION_HEX >= 0x03000000
821 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
822 #else
823 # define SWIG_Python_str_DelForPy3(x)
824 #endif
825 
826 
827 SWIGINTERN PyObject*
828 SWIG_Python_str_FromChar(const char *c)
829 {
830 #if PY_VERSION_HEX >= 0x03000000
831  return PyUnicode_FromString(c);
832 #else
833  return PyString_FromString(c);
834 #endif
835 }
836 
837 /* Add PyOS_snprintf for old Pythons */
838 #if PY_VERSION_HEX < 0x02020000
839 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
840 # define PyOS_snprintf _snprintf
841 # else
842 # define PyOS_snprintf snprintf
843 # endif
844 #endif
845 
846 /* A crude PyString_FromFormat implementation for old Pythons */
847 #if PY_VERSION_HEX < 0x02020000
848 
849 #ifndef SWIG_PYBUFFER_SIZE
850 # define SWIG_PYBUFFER_SIZE 1024
851 #endif
852 
853 static PyObject *
854 PyString_FromFormat(const char *fmt, ...) {
855  va_list ap;
856  char buf[SWIG_PYBUFFER_SIZE * 2];
857  int res;
858  va_start(ap, fmt);
859  res = vsnprintf(buf, sizeof(buf), fmt, ap);
860  va_end(ap);
861  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
862 }
863 #endif
864 
865 #ifndef PyObject_DEL
866 # define PyObject_DEL PyObject_Del
867 #endif
868 
869 /* A crude PyExc_StopIteration exception for old Pythons */
870 #if PY_VERSION_HEX < 0x02020000
871 # ifndef PyExc_StopIteration
872 # define PyExc_StopIteration PyExc_RuntimeError
873 # endif
874 # ifndef PyObject_GenericGetAttr
875 # define PyObject_GenericGetAttr 0
876 # endif
877 #endif
878 
879 /* Py_NotImplemented is defined in 2.1 and up. */
880 #if PY_VERSION_HEX < 0x02010000
881 # ifndef Py_NotImplemented
882 # define Py_NotImplemented PyExc_RuntimeError
883 # endif
884 #endif
885 
886 /* A crude PyString_AsStringAndSize implementation for old Pythons */
887 #if PY_VERSION_HEX < 0x02010000
888 # ifndef PyString_AsStringAndSize
889 # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
890 # endif
891 #endif
892 
893 /* PySequence_Size for old Pythons */
894 #if PY_VERSION_HEX < 0x02000000
895 # ifndef PySequence_Size
896 # define PySequence_Size PySequence_Length
897 # endif
898 #endif
899 
900 /* PyBool_FromLong for old Pythons */
901 #if PY_VERSION_HEX < 0x02030000
902 static
903 PyObject *PyBool_FromLong(long ok)
904 {
905  PyObject *result = ok ? Py_True : Py_False;
906  Py_INCREF(result);
907  return result;
908 }
909 #endif
910 
911 /* Py_ssize_t for old Pythons */
912 /* This code is as recommended by: */
913 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
914 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
915 typedef int Py_ssize_t;
916 # define PY_SSIZE_T_MAX INT_MAX
917 # define PY_SSIZE_T_MIN INT_MIN
918 typedef inquiry lenfunc;
919 typedef intargfunc ssizeargfunc;
920 typedef intintargfunc ssizessizeargfunc;
921 typedef intobjargproc ssizeobjargproc;
922 typedef intintobjargproc ssizessizeobjargproc;
923 typedef getreadbufferproc readbufferproc;
924 typedef getwritebufferproc writebufferproc;
925 typedef getsegcountproc segcountproc;
926 typedef getcharbufferproc charbufferproc;
927 static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
928 {
929  long result = 0;
930  PyObject *i = PyNumber_Int(x);
931  if (i) {
932  result = PyInt_AsLong(i);
933  Py_DECREF(i);
934  }
935  return result;
936 }
937 #endif
938 
939 #if PY_VERSION_HEX < 0x02050000
940 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
941 #endif
942 
943 #if PY_VERSION_HEX < 0x02040000
944 #define Py_VISIT(op) \
945  do { \
946  if (op) { \
947  int vret = visit((op), arg); \
948  if (vret) \
949  return vret; \
950  } \
951  } while (0)
952 #endif
953 
954 #if PY_VERSION_HEX < 0x02030000
955 typedef struct {
956  PyTypeObject type;
957  PyNumberMethods as_number;
958  PyMappingMethods as_mapping;
959  PySequenceMethods as_sequence;
960  PyBufferProcs as_buffer;
961  PyObject *name, *slots;
963 #endif
964 
965 #if PY_VERSION_HEX < 0x02030000
966 typedef destructor freefunc;
967 #endif
968 
969 #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
970  (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
971  (PY_MAJOR_VERSION > 3))
972 # define SWIGPY_USE_CAPSULE
973 # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
974 #endif
975 
976 #if PY_VERSION_HEX < 0x03020000
977 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
978 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
979 #define Py_hash_t long
980 #endif
981 
982 /* -----------------------------------------------------------------------------
983  * error manipulation
984  * ----------------------------------------------------------------------------- */
985 
986 SWIGRUNTIME PyObject*
987 SWIG_Python_ErrorType(int code) {
988  PyObject* type = 0;
989  switch(code) {
990  case SWIG_MemoryError:
991  type = PyExc_MemoryError;
992  break;
993  case SWIG_IOError:
994  type = PyExc_IOError;
995  break;
996  case SWIG_RuntimeError:
997  type = PyExc_RuntimeError;
998  break;
999  case SWIG_IndexError:
1000  type = PyExc_IndexError;
1001  break;
1002  case SWIG_TypeError:
1003  type = PyExc_TypeError;
1004  break;
1005  case SWIG_DivisionByZero:
1006  type = PyExc_ZeroDivisionError;
1007  break;
1008  case SWIG_OverflowError:
1009  type = PyExc_OverflowError;
1010  break;
1011  case SWIG_SyntaxError:
1012  type = PyExc_SyntaxError;
1013  break;
1014  case SWIG_ValueError:
1015  type = PyExc_ValueError;
1016  break;
1017  case SWIG_SystemError:
1018  type = PyExc_SystemError;
1019  break;
1020  case SWIG_AttributeError:
1021  type = PyExc_AttributeError;
1022  break;
1023  default:
1024  type = PyExc_RuntimeError;
1025  }
1026  return type;
1027 }
1028 
1029 
1030 SWIGRUNTIME void
1031 SWIG_Python_AddErrorMsg(const char* mesg)
1032 {
1033  PyObject *type = 0;
1034  PyObject *value = 0;
1035  PyObject *traceback = 0;
1036 
1037  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1038  if (value) {
1039  char *tmp;
1040  PyObject *old_str = PyObject_Str(value);
1041  PyErr_Clear();
1042  Py_XINCREF(type);
1043 
1044  PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1045  SWIG_Python_str_DelForPy3(tmp);
1046  Py_DECREF(old_str);
1047  Py_DECREF(value);
1048  } else {
1049  PyErr_SetString(PyExc_RuntimeError, mesg);
1050  }
1051 }
1052 
1053 #if defined(SWIG_PYTHON_NO_THREADS)
1054 # if defined(SWIG_PYTHON_THREADS)
1055 # undef SWIG_PYTHON_THREADS
1056 # endif
1057 #endif
1058 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1059 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1060 # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1061 # define SWIG_PYTHON_USE_GIL
1062 # endif
1063 # endif
1064 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1065 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
1066 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
1067 # endif
1068 # ifdef __cplusplus /* C++ code */
1069  class SWIG_Python_Thread_Block {
1070  bool status;
1071  PyGILState_STATE state;
1072  public:
1073  void end() { if (status) { PyGILState_Release(state); status = false;} }
1074  SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
1075  ~SWIG_Python_Thread_Block() { end(); }
1076  };
1077  class SWIG_Python_Thread_Allow {
1078  bool status;
1079  PyThreadState *save;
1080  public:
1081  void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1082  SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1083  ~SWIG_Python_Thread_Allow() { end(); }
1084  };
1085 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1086 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1087 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1088 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1089 # else /* C code */
1090 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1091 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1092 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1093 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1094 # endif
1095 # else /* Old thread way, not implemented, user must provide it */
1096 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1097 # define SWIG_PYTHON_INITIALIZE_THREADS
1098 # endif
1099 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1100 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1101 # endif
1102 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1103 # define SWIG_PYTHON_THREAD_END_BLOCK
1104 # endif
1105 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1106 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1107 # endif
1108 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1109 # define SWIG_PYTHON_THREAD_END_ALLOW
1110 # endif
1111 # endif
1112 #else /* No thread support */
1113 # define SWIG_PYTHON_INITIALIZE_THREADS
1114 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1115 # define SWIG_PYTHON_THREAD_END_BLOCK
1116 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1117 # define SWIG_PYTHON_THREAD_END_ALLOW
1118 #endif
1119 
1120 /* -----------------------------------------------------------------------------
1121  * Python API portion that goes into the runtime
1122  * ----------------------------------------------------------------------------- */
1123 
1124 #ifdef __cplusplus
1125 extern "C" {
1126 #endif
1127 
1128 /* -----------------------------------------------------------------------------
1129  * Constant declarations
1130  * ----------------------------------------------------------------------------- */
1131 
1132 /* Constant Types */
1133 #define SWIG_PY_POINTER 4
1134 #define SWIG_PY_BINARY 5
1135 
1136 /* Constant information structure */
1137 typedef struct swig_const_info {
1138  int type;
1139  char *name;
1140  long lvalue;
1141  double dvalue;
1142  void *pvalue;
1143  swig_type_info **ptype;
1144 } swig_const_info;
1145 
1146 
1147 /* -----------------------------------------------------------------------------
1148  * Wrapper of PyInstanceMethod_New() used in Python 3
1149  * It is exported to the generated module, used for -fastproxy
1150  * ----------------------------------------------------------------------------- */
1151 #if PY_VERSION_HEX >= 0x03000000
1152 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1153 {
1154  return PyInstanceMethod_New(func);
1155 }
1156 #else
1157 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1158 {
1159  return NULL;
1160 }
1161 #endif
1162 
1163 #ifdef __cplusplus
1164 }
1165 #endif
1166 
1167 
1168 /* -----------------------------------------------------------------------------
1169  * pyrun.swg
1170  *
1171  * This file contains the runtime support for Python modules
1172  * and includes code for managing global variables and pointer
1173  * type checking.
1174  *
1175  * ----------------------------------------------------------------------------- */
1176 
1177 /* Common SWIG API */
1178 
1179 /* for raw pointers */
1180 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1181 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1182 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1183 
1184 #ifdef SWIGPYTHON_BUILTIN
1185 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1186 #else
1187 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1188 #endif
1189 
1190 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1191 
1192 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1193 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1194 #define swig_owntype int
1195 
1196 /* for raw packed data */
1197 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1198 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1199 
1200 /* for class or struct pointers */
1201 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1202 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1203 
1204 /* for C or C++ function pointers */
1205 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1206 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1207 
1208 /* for C++ member pointers, ie, member methods */
1209 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1210 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1211 
1212 
1213 /* Runtime API */
1214 
1215 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1216 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1217 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1218 
1219 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1220 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1221 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1222 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1223 #define SWIG_fail goto fail
1224 
1225 
1226 /* Runtime API implementation */
1227 
1228 /* Error manipulation */
1229 
1230 SWIGINTERN void
1231 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1232  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1233  PyErr_SetObject(errtype, obj);
1234  Py_DECREF(obj);
1235  SWIG_PYTHON_THREAD_END_BLOCK;
1236 }
1237 
1238 SWIGINTERN void
1239 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1240  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1241  PyErr_SetString(errtype, msg);
1242  SWIG_PYTHON_THREAD_END_BLOCK;
1243 }
1244 
1245 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1246 
1247 /* Set a constant value */
1248 
1249 #if defined(SWIGPYTHON_BUILTIN)
1250 
1251 SWIGINTERN void
1252 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1253  PyObject *s = PyString_InternFromString(key);
1254  PyList_Append(seq, s);
1255  Py_DECREF(s);
1256 }
1257 
1258 SWIGINTERN void
1259 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1260 #if PY_VERSION_HEX < 0x02030000
1261  PyDict_SetItemString(d, (char *)name, obj);
1262 #else
1263  PyDict_SetItemString(d, name, obj);
1264 #endif
1265  Py_DECREF(obj);
1266  if (public_interface)
1267  SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1268 }
1269 
1270 #else
1271 
1272 SWIGINTERN void
1273 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1274 #if PY_VERSION_HEX < 0x02030000
1275  PyDict_SetItemString(d, (char *)name, obj);
1276 #else
1277  PyDict_SetItemString(d, name, obj);
1278 #endif
1279  Py_DECREF(obj);
1280 }
1281 
1282 #endif
1283 
1284 /* Append a value to the result obj */
1285 
1286 SWIGINTERN PyObject*
1287 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1288 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1289  if (!result) {
1290  result = obj;
1291  } else if (result == Py_None) {
1292  Py_DECREF(result);
1293  result = obj;
1294  } else {
1295  if (!PyList_Check(result)) {
1296  PyObject *o2 = result;
1297  result = PyList_New(1);
1298  PyList_SetItem(result, 0, o2);
1299  }
1300  PyList_Append(result,obj);
1301  Py_DECREF(obj);
1302  }
1303  return result;
1304 #else
1305  PyObject* o2;
1306  PyObject* o3;
1307  if (!result) {
1308  result = obj;
1309  } else if (result == Py_None) {
1310  Py_DECREF(result);
1311  result = obj;
1312  } else {
1313  if (!PyTuple_Check(result)) {
1314  o2 = result;
1315  result = PyTuple_New(1);
1316  PyTuple_SET_ITEM(result, 0, o2);
1317  }
1318  o3 = PyTuple_New(1);
1319  PyTuple_SET_ITEM(o3, 0, obj);
1320  o2 = result;
1321  result = PySequence_Concat(o2, o3);
1322  Py_DECREF(o2);
1323  Py_DECREF(o3);
1324  }
1325  return result;
1326 #endif
1327 }
1328 
1329 /* Unpack the argument tuple */
1330 
1331 SWIGINTERN Py_ssize_t
1332 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1333 {
1334  if (!args) {
1335  if (!min && !max) {
1336  return 1;
1337  } else {
1338  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1339  name, (min == max ? "" : "at least "), (int)min);
1340  return 0;
1341  }
1342  }
1343  if (!PyTuple_Check(args)) {
1344  if (min <= 1 && max >= 1) {
1345  Py_ssize_t i;
1346  objs[0] = args;
1347  for (i = 1; i < max; ++i) {
1348  objs[i] = 0;
1349  }
1350  return 2;
1351  }
1352  PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1353  return 0;
1354  } else {
1355  Py_ssize_t l = PyTuple_GET_SIZE(args);
1356  if (l < min) {
1357  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1358  name, (min == max ? "" : "at least "), (int)min, (int)l);
1359  return 0;
1360  } else if (l > max) {
1361  PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1362  name, (min == max ? "" : "at most "), (int)max, (int)l);
1363  return 0;
1364  } else {
1365  Py_ssize_t i;
1366  for (i = 0; i < l; ++i) {
1367  objs[i] = PyTuple_GET_ITEM(args, i);
1368  }
1369  for (; l < max; ++l) {
1370  objs[l] = 0;
1371  }
1372  return i + 1;
1373  }
1374  }
1375 }
1376 
1377 /* A functor is a function object with one single object argument */
1378 #if PY_VERSION_HEX >= 0x02020000
1379 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1380 #else
1381 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1382 #endif
1383 
1384 /*
1385  Helper for static pointer initialization for both C and C++ code, for example
1386  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1387 */
1388 #ifdef __cplusplus
1389 #define SWIG_STATIC_POINTER(var) var
1390 #else
1391 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1392 #endif
1393 
1394 /* -----------------------------------------------------------------------------
1395  * Pointer declarations
1396  * ----------------------------------------------------------------------------- */
1397 
1398 /* Flags for new pointer objects */
1399 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1400 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1401 
1402 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1403 
1404 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1405 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1406 
1407 #ifdef __cplusplus
1408 extern "C" {
1409 #endif
1410 
1411 /* How to access Py_None */
1412 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1413 # ifndef SWIG_PYTHON_NO_BUILD_NONE
1414 # ifndef SWIG_PYTHON_BUILD_NONE
1415 # define SWIG_PYTHON_BUILD_NONE
1416 # endif
1417 # endif
1418 #endif
1419 
1420 #ifdef SWIG_PYTHON_BUILD_NONE
1421 # ifdef Py_None
1422 # undef Py_None
1423 # define Py_None SWIG_Py_None()
1424 # endif
1425 SWIGRUNTIMEINLINE PyObject *
1426 _SWIG_Py_None(void)
1427 {
1428  PyObject *none = Py_BuildValue((char*)"");
1429  Py_DECREF(none);
1430  return none;
1431 }
1432 SWIGRUNTIME PyObject *
1433 SWIG_Py_None(void)
1434 {
1435  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1436  return none;
1437 }
1438 #endif
1439 
1440 /* The python void return value */
1441 
1442 SWIGRUNTIMEINLINE PyObject *
1443 SWIG_Py_Void(void)
1444 {
1445  PyObject *none = Py_None;
1446  Py_INCREF(none);
1447  return none;
1448 }
1449 
1450 /* SwigPyClientData */
1451 
1452 typedef struct {
1453  PyObject *klass;
1454  PyObject *newraw;
1455  PyObject *newargs;
1456  PyObject *destroy;
1457  int delargs;
1458  int implicitconv;
1459  PyTypeObject *pytype;
1461 
1462 SWIGRUNTIMEINLINE int
1463 SWIG_Python_CheckImplicit(swig_type_info *ty)
1464 {
1465  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1466  return data ? data->implicitconv : 0;
1467 }
1468 
1469 SWIGRUNTIMEINLINE PyObject *
1470 SWIG_Python_ExceptionType(swig_type_info *desc) {
1471  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1472  PyObject *klass = data ? data->klass : 0;
1473  return (klass ? klass : PyExc_RuntimeError);
1474 }
1475 
1476 
1477 SWIGRUNTIME SwigPyClientData *
1478 SwigPyClientData_New(PyObject* obj)
1479 {
1480  if (!obj) {
1481  return 0;
1482  } else {
1483  SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1484  /* the klass element */
1485  data->klass = obj;
1486  Py_INCREF(data->klass);
1487  /* the newraw method and newargs arguments used to create a new raw instance */
1488  if (PyClass_Check(obj)) {
1489  data->newraw = 0;
1490  data->newargs = obj;
1491  Py_INCREF(obj);
1492  } else {
1493 #if (PY_VERSION_HEX < 0x02020000)
1494  data->newraw = 0;
1495 #else
1496  data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1497 #endif
1498  if (data->newraw) {
1499  Py_INCREF(data->newraw);
1500  data->newargs = PyTuple_New(1);
1501  PyTuple_SetItem(data->newargs, 0, obj);
1502  } else {
1503  data->newargs = obj;
1504  }
1505  Py_INCREF(data->newargs);
1506  }
1507  /* the destroy method, aka as the C++ delete method */
1508  data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1509  if (PyErr_Occurred()) {
1510  PyErr_Clear();
1511  data->destroy = 0;
1512  }
1513  if (data->destroy) {
1514  int flags;
1515  Py_INCREF(data->destroy);
1516  flags = PyCFunction_GET_FLAGS(data->destroy);
1517 #ifdef METH_O
1518  data->delargs = !(flags & (METH_O));
1519 #else
1520  data->delargs = 0;
1521 #endif
1522  } else {
1523  data->delargs = 0;
1524  }
1525  data->implicitconv = 0;
1526  data->pytype = 0;
1527  return data;
1528  }
1529 }
1530 
1531 SWIGRUNTIME void
1532 SwigPyClientData_Del(SwigPyClientData *data) {
1533  Py_XDECREF(data->newraw);
1534  Py_XDECREF(data->newargs);
1535  Py_XDECREF(data->destroy);
1536 }
1537 
1538 /* =============== SwigPyObject =====================*/
1539 
1540 typedef struct {
1541  PyObject_HEAD
1542  void *ptr;
1543  swig_type_info *ty;
1544  int own;
1545  PyObject *next;
1546 #ifdef SWIGPYTHON_BUILTIN
1547  PyObject *dict;
1548 #endif
1549 } SwigPyObject;
1550 
1551 
1552 #ifdef SWIGPYTHON_BUILTIN
1553 
1554 SWIGRUNTIME PyObject *
1555 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1556 {
1557  SwigPyObject *sobj = (SwigPyObject *)v;
1558 
1559  if (!sobj->dict)
1560  sobj->dict = PyDict_New();
1561 
1562  Py_INCREF(sobj->dict);
1563  return sobj->dict;
1564 }
1565 
1566 #endif
1567 
1568 SWIGRUNTIME PyObject *
1569 SwigPyObject_long(SwigPyObject *v)
1570 {
1571  return PyLong_FromVoidPtr(v->ptr);
1572 }
1573 
1574 SWIGRUNTIME PyObject *
1575 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1576 {
1577  PyObject *res = NULL;
1578  PyObject *args = PyTuple_New(1);
1579  if (args) {
1580  if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1581  PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1582  if (ofmt) {
1583 #if PY_VERSION_HEX >= 0x03000000
1584  res = PyUnicode_Format(ofmt,args);
1585 #else
1586  res = PyString_Format(ofmt,args);
1587 #endif
1588  Py_DECREF(ofmt);
1589  }
1590  Py_DECREF(args);
1591  }
1592  }
1593  return res;
1594 }
1595 
1596 SWIGRUNTIME PyObject *
1597 SwigPyObject_oct(SwigPyObject *v)
1598 {
1599  return SwigPyObject_format("%o",v);
1600 }
1601 
1602 SWIGRUNTIME PyObject *
1603 SwigPyObject_hex(SwigPyObject *v)
1604 {
1605  return SwigPyObject_format("%x",v);
1606 }
1607 
1608 SWIGRUNTIME PyObject *
1609 #ifdef METH_NOARGS
1610 SwigPyObject_repr(SwigPyObject *v)
1611 #else
1612 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1613 #endif
1614 {
1615  const char *name = SWIG_TypePrettyName(v->ty);
1616  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1617  if (v->next) {
1618 # ifdef METH_NOARGS
1619  PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1620 # else
1621  PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1622 # endif
1623 # if PY_VERSION_HEX >= 0x03000000
1624  PyObject *joined = PyUnicode_Concat(repr, nrep);
1625  Py_DecRef(repr);
1626  Py_DecRef(nrep);
1627  repr = joined;
1628 # else
1629  PyString_ConcatAndDel(&repr,nrep);
1630 # endif
1631  }
1632  return repr;
1633 }
1634 
1635 SWIGRUNTIME int
1636 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1637 {
1638  void *i = v->ptr;
1639  void *j = w->ptr;
1640  return (i < j) ? -1 : ((i > j) ? 1 : 0);
1641 }
1642 
1643 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1644 SWIGRUNTIME PyObject*
1645 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1646 {
1647  PyObject* res;
1648  if( op != Py_EQ && op != Py_NE ) {
1649  Py_INCREF(Py_NotImplemented);
1650  return Py_NotImplemented;
1651  }
1652  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1653  return res;
1654 }
1655 
1656 
1657 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1658 
1659 #ifdef SWIGPYTHON_BUILTIN
1660 static swig_type_info *SwigPyObject_stype = 0;
1661 SWIGRUNTIME PyTypeObject*
1662 SwigPyObject_type(void) {
1663  SwigPyClientData *cd;
1664  assert(SwigPyObject_stype);
1665  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1666  assert(cd);
1667  assert(cd->pytype);
1668  return cd->pytype;
1669 }
1670 #else
1671 SWIGRUNTIME PyTypeObject*
1672 SwigPyObject_type(void) {
1673  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1674  return type;
1675 }
1676 #endif
1677 
1678 SWIGRUNTIMEINLINE int
1679 SwigPyObject_Check(PyObject *op) {
1680 #ifdef SWIGPYTHON_BUILTIN
1681  PyTypeObject *target_tp = SwigPyObject_type();
1682  if (PyType_IsSubtype(op->ob_type, target_tp))
1683  return 1;
1684  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1685 #else
1686  return (Py_TYPE(op) == SwigPyObject_type())
1687  || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1688 #endif
1689 }
1690 
1691 SWIGRUNTIME PyObject *
1692 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1693 
1694 SWIGRUNTIME void
1695 SwigPyObject_dealloc(PyObject *v)
1696 {
1697  SwigPyObject *sobj = (SwigPyObject *) v;
1698  PyObject *next = sobj->next;
1699  if (sobj->own == SWIG_POINTER_OWN) {
1700  swig_type_info *ty = sobj->ty;
1701  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1702  PyObject *destroy = data ? data->destroy : 0;
1703  if (destroy) {
1704  /* destroy is always a VARARGS method */
1705  PyObject *res;
1706 
1707  /* PyObject_CallFunction() has the potential to silently drop
1708  the active active exception. In cases of unnamed temporary
1709  variable or where we just finished iterating over a generator
1710  StopIteration will be active right now, and this needs to
1711  remain true upon return from SwigPyObject_dealloc. So save
1712  and restore. */
1713 
1714  PyObject *val = NULL, *type = NULL, *tb = NULL;
1715  PyErr_Fetch(&val, &type, &tb);
1716 
1717  if (data->delargs) {
1718  /* we need to create a temporary object to carry the destroy operation */
1719  PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1720  res = SWIG_Python_CallFunctor(destroy, tmp);
1721  Py_DECREF(tmp);
1722  } else {
1723  PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1724  PyObject *mself = PyCFunction_GET_SELF(destroy);
1725  res = ((*meth)(mself, v));
1726  }
1727  if (!res)
1728  PyErr_WriteUnraisable(destroy);
1729 
1730  PyErr_Restore(val, type, tb);
1731 
1732  Py_XDECREF(res);
1733  }
1734 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1735  else {
1736  const char *name = SWIG_TypePrettyName(ty);
1737  printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1738  }
1739 #endif
1740  }
1741  Py_XDECREF(next);
1742  PyObject_DEL(v);
1743 }
1744 
1745 SWIGRUNTIME PyObject*
1746 SwigPyObject_append(PyObject* v, PyObject* next)
1747 {
1748  SwigPyObject *sobj = (SwigPyObject *) v;
1749 #ifndef METH_O
1750  PyObject *tmp = 0;
1751  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1752  next = tmp;
1753 #endif
1754  if (!SwigPyObject_Check(next)) {
1755  PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1756  return NULL;
1757  }
1758  sobj->next = next;
1759  Py_INCREF(next);
1760  return SWIG_Py_Void();
1761 }
1762 
1763 SWIGRUNTIME PyObject*
1764 #ifdef METH_NOARGS
1765 SwigPyObject_next(PyObject* v)
1766 #else
1767 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1768 #endif
1769 {
1770  SwigPyObject *sobj = (SwigPyObject *) v;
1771  if (sobj->next) {
1772  Py_INCREF(sobj->next);
1773  return sobj->next;
1774  } else {
1775  return SWIG_Py_Void();
1776  }
1777 }
1778 
1779 SWIGINTERN PyObject*
1780 #ifdef METH_NOARGS
1781 SwigPyObject_disown(PyObject *v)
1782 #else
1783 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1784 #endif
1785 {
1786  SwigPyObject *sobj = (SwigPyObject *)v;
1787  sobj->own = 0;
1788  return SWIG_Py_Void();
1789 }
1790 
1791 SWIGINTERN PyObject*
1792 #ifdef METH_NOARGS
1793 SwigPyObject_acquire(PyObject *v)
1794 #else
1795 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1796 #endif
1797 {
1798  SwigPyObject *sobj = (SwigPyObject *)v;
1799  sobj->own = SWIG_POINTER_OWN;
1800  return SWIG_Py_Void();
1801 }
1802 
1803 SWIGINTERN PyObject*
1804 SwigPyObject_own(PyObject *v, PyObject *args)
1805 {
1806  PyObject *val = 0;
1807 #if (PY_VERSION_HEX < 0x02020000)
1808  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1809 #elif (PY_VERSION_HEX < 0x02050000)
1810  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1811 #else
1812  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1813 #endif
1814  {
1815  return NULL;
1816  }
1817  else
1818  {
1819  SwigPyObject *sobj = (SwigPyObject *)v;
1820  PyObject *obj = PyBool_FromLong(sobj->own);
1821  if (val) {
1822 #ifdef METH_NOARGS
1823  if (PyObject_IsTrue(val)) {
1824  SwigPyObject_acquire(v);
1825  } else {
1826  SwigPyObject_disown(v);
1827  }
1828 #else
1829  if (PyObject_IsTrue(val)) {
1830  SwigPyObject_acquire(v,args);
1831  } else {
1832  SwigPyObject_disown(v,args);
1833  }
1834 #endif
1835  }
1836  return obj;
1837  }
1838 }
1839 
1840 #ifdef METH_O
1841 static PyMethodDef
1842 swigobject_methods[] = {
1843  {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1844  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
1845  {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1846  {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1847  {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1848  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1849  {0, 0, 0, 0}
1850 };
1851 #else
1852 static PyMethodDef
1853 swigobject_methods[] = {
1854  {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1855  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
1856  {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1857  {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1858  {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1859  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1860  {0, 0, 0, 0}
1861 };
1862 #endif
1863 
1864 #if PY_VERSION_HEX < 0x02020000
1865 SWIGINTERN PyObject *
1866 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1867 {
1868  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1869 }
1870 #endif
1871 
1872 SWIGRUNTIME PyTypeObject*
1873 SwigPyObject_TypeOnce(void) {
1874  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1875 
1876  static PyNumberMethods SwigPyObject_as_number = {
1877  (binaryfunc)0, /*nb_add*/
1878  (binaryfunc)0, /*nb_subtract*/
1879  (binaryfunc)0, /*nb_multiply*/
1880  /* nb_divide removed in Python 3 */
1881 #if PY_VERSION_HEX < 0x03000000
1882  (binaryfunc)0, /*nb_divide*/
1883 #endif
1884  (binaryfunc)0, /*nb_remainder*/
1885  (binaryfunc)0, /*nb_divmod*/
1886  (ternaryfunc)0,/*nb_power*/
1887  (unaryfunc)0, /*nb_negative*/
1888  (unaryfunc)0, /*nb_positive*/
1889  (unaryfunc)0, /*nb_absolute*/
1890  (inquiry)0, /*nb_nonzero*/
1891  0, /*nb_invert*/
1892  0, /*nb_lshift*/
1893  0, /*nb_rshift*/
1894  0, /*nb_and*/
1895  0, /*nb_xor*/
1896  0, /*nb_or*/
1897 #if PY_VERSION_HEX < 0x03000000
1898  0, /*nb_coerce*/
1899 #endif
1900  (unaryfunc)SwigPyObject_long, /*nb_int*/
1901 #if PY_VERSION_HEX < 0x03000000
1902  (unaryfunc)SwigPyObject_long, /*nb_long*/
1903 #else
1904  0, /*nb_reserved*/
1905 #endif
1906  (unaryfunc)0, /*nb_float*/
1907 #if PY_VERSION_HEX < 0x03000000
1908  (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1909  (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1910 #endif
1911 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1912  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1913 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1914  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1915 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1916  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1917 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1918  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1919 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1920  0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1921 #endif
1922  };
1923 
1924  static PyTypeObject swigpyobject_type;
1925  static int type_init = 0;
1926  if (!type_init) {
1927  const PyTypeObject tmp = {
1928 #if PY_VERSION_HEX >= 0x03000000
1929  PyVarObject_HEAD_INIT(NULL, 0)
1930 #else
1931  PyObject_HEAD_INIT(NULL)
1932  0, /* ob_size */
1933 #endif
1934  (char *)"SwigPyObject", /* tp_name */
1935  sizeof(SwigPyObject), /* tp_basicsize */
1936  0, /* tp_itemsize */
1937  (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1938  0, /* tp_print */
1939 #if PY_VERSION_HEX < 0x02020000
1940  (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1941 #else
1942  (getattrfunc)0, /* tp_getattr */
1943 #endif
1944  (setattrfunc)0, /* tp_setattr */
1945 #if PY_VERSION_HEX >= 0x03000000
1946  0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1947 #else
1948  (cmpfunc)SwigPyObject_compare, /* tp_compare */
1949 #endif
1950  (reprfunc)SwigPyObject_repr, /* tp_repr */
1951  &SwigPyObject_as_number, /* tp_as_number */
1952  0, /* tp_as_sequence */
1953  0, /* tp_as_mapping */
1954  (hashfunc)0, /* tp_hash */
1955  (ternaryfunc)0, /* tp_call */
1956  0, /* tp_str */
1957  PyObject_GenericGetAttr, /* tp_getattro */
1958  0, /* tp_setattro */
1959  0, /* tp_as_buffer */
1960  Py_TPFLAGS_DEFAULT, /* tp_flags */
1961  swigobject_doc, /* tp_doc */
1962  0, /* tp_traverse */
1963  0, /* tp_clear */
1964  (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1965  0, /* tp_weaklistoffset */
1966 #if PY_VERSION_HEX >= 0x02020000
1967  0, /* tp_iter */
1968  0, /* tp_iternext */
1969  swigobject_methods, /* tp_methods */
1970  0, /* tp_members */
1971  0, /* tp_getset */
1972  0, /* tp_base */
1973  0, /* tp_dict */
1974  0, /* tp_descr_get */
1975  0, /* tp_descr_set */
1976  0, /* tp_dictoffset */
1977  0, /* tp_init */
1978  0, /* tp_alloc */
1979  0, /* tp_new */
1980  0, /* tp_free */
1981  0, /* tp_is_gc */
1982  0, /* tp_bases */
1983  0, /* tp_mro */
1984  0, /* tp_cache */
1985  0, /* tp_subclasses */
1986  0, /* tp_weaklist */
1987 #endif
1988 #if PY_VERSION_HEX >= 0x02030000
1989  0, /* tp_del */
1990 #endif
1991 #if PY_VERSION_HEX >= 0x02060000
1992  0, /* tp_version_tag */
1993 #endif
1994 #if PY_VERSION_HEX >= 0x03040000
1995  0, /* tp_finalize */
1996 #endif
1997 #ifdef COUNT_ALLOCS
1998  0, /* tp_allocs */
1999  0, /* tp_frees */
2000  0, /* tp_maxalloc */
2001 #if PY_VERSION_HEX >= 0x02050000
2002  0, /* tp_prev */
2003 #endif
2004  0 /* tp_next */
2005 #endif
2006  };
2007  swigpyobject_type = tmp;
2008  type_init = 1;
2009 #if PY_VERSION_HEX < 0x02020000
2010  swigpyobject_type.ob_type = &PyType_Type;
2011 #else
2012  if (PyType_Ready(&swigpyobject_type) < 0)
2013  return NULL;
2014 #endif
2015  }
2016  return &swigpyobject_type;
2017 }
2018 
2019 SWIGRUNTIME PyObject *
2020 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
2021 {
2022  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
2023  if (sobj) {
2024  sobj->ptr = ptr;
2025  sobj->ty = ty;
2026  sobj->own = own;
2027  sobj->next = 0;
2028  }
2029  return (PyObject *)sobj;
2030 }
2031 
2032 /* -----------------------------------------------------------------------------
2033  * Implements a simple Swig Packed type, and use it instead of string
2034  * ----------------------------------------------------------------------------- */
2035 
2036 typedef struct {
2037  PyObject_HEAD
2038  void *pack;
2039  swig_type_info *ty;
2040  size_t size;
2041 } SwigPyPacked;
2042 
2043 SWIGRUNTIME int
2044 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
2045 {
2046  char result[SWIG_BUFFER_SIZE];
2047  fputs("<Swig Packed ", fp);
2048  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2049  fputs("at ", fp);
2050  fputs(result, fp);
2051  }
2052  fputs(v->ty->name,fp);
2053  fputs(">", fp);
2054  return 0;
2055 }
2056 
2057 SWIGRUNTIME PyObject *
2058 SwigPyPacked_repr(SwigPyPacked *v)
2059 {
2060  char result[SWIG_BUFFER_SIZE];
2061  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2062  return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2063  } else {
2064  return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2065  }
2066 }
2067 
2068 SWIGRUNTIME PyObject *
2069 SwigPyPacked_str(SwigPyPacked *v)
2070 {
2071  char result[SWIG_BUFFER_SIZE];
2072  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2073  return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2074  } else {
2075  return SWIG_Python_str_FromChar(v->ty->name);
2076  }
2077 }
2078 
2079 SWIGRUNTIME int
2080 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2081 {
2082  size_t i = v->size;
2083  size_t j = w->size;
2084  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2085  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2086 }
2087 
2088 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2089 
2090 SWIGRUNTIME PyTypeObject*
2091 SwigPyPacked_type(void) {
2092  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2093  return type;
2094 }
2095 
2096 SWIGRUNTIMEINLINE int
2097 SwigPyPacked_Check(PyObject *op) {
2098  return ((op)->ob_type == SwigPyPacked_TypeOnce())
2099  || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2100 }
2101 
2102 SWIGRUNTIME void
2103 SwigPyPacked_dealloc(PyObject *v)
2104 {
2105  if (SwigPyPacked_Check(v)) {
2106  SwigPyPacked *sobj = (SwigPyPacked *) v;
2107  free(sobj->pack);
2108  }
2109  PyObject_DEL(v);
2110 }
2111 
2112 SWIGRUNTIME PyTypeObject*
2113 SwigPyPacked_TypeOnce(void) {
2114  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2115  static PyTypeObject swigpypacked_type;
2116  static int type_init = 0;
2117  if (!type_init) {
2118  const PyTypeObject tmp = {
2119 #if PY_VERSION_HEX>=0x03000000
2120  PyVarObject_HEAD_INIT(NULL, 0)
2121 #else
2122  PyObject_HEAD_INIT(NULL)
2123  0, /* ob_size */
2124 #endif
2125  (char *)"SwigPyPacked", /* tp_name */
2126  sizeof(SwigPyPacked), /* tp_basicsize */
2127  0, /* tp_itemsize */
2128  (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2129  (printfunc)SwigPyPacked_print, /* tp_print */
2130  (getattrfunc)0, /* tp_getattr */
2131  (setattrfunc)0, /* tp_setattr */
2132 #if PY_VERSION_HEX>=0x03000000
2133  0, /* tp_reserved in 3.0.1 */
2134 #else
2135  (cmpfunc)SwigPyPacked_compare, /* tp_compare */
2136 #endif
2137  (reprfunc)SwigPyPacked_repr, /* tp_repr */
2138  0, /* tp_as_number */
2139  0, /* tp_as_sequence */
2140  0, /* tp_as_mapping */
2141  (hashfunc)0, /* tp_hash */
2142  (ternaryfunc)0, /* tp_call */
2143  (reprfunc)SwigPyPacked_str, /* tp_str */
2144  PyObject_GenericGetAttr, /* tp_getattro */
2145  0, /* tp_setattro */
2146  0, /* tp_as_buffer */
2147  Py_TPFLAGS_DEFAULT, /* tp_flags */
2148  swigpacked_doc, /* tp_doc */
2149  0, /* tp_traverse */
2150  0, /* tp_clear */
2151  0, /* tp_richcompare */
2152  0, /* tp_weaklistoffset */
2153 #if PY_VERSION_HEX >= 0x02020000
2154  0, /* tp_iter */
2155  0, /* tp_iternext */
2156  0, /* tp_methods */
2157  0, /* tp_members */
2158  0, /* tp_getset */
2159  0, /* tp_base */
2160  0, /* tp_dict */
2161  0, /* tp_descr_get */
2162  0, /* tp_descr_set */
2163  0, /* tp_dictoffset */
2164  0, /* tp_init */
2165  0, /* tp_alloc */
2166  0, /* tp_new */
2167  0, /* tp_free */
2168  0, /* tp_is_gc */
2169  0, /* tp_bases */
2170  0, /* tp_mro */
2171  0, /* tp_cache */
2172  0, /* tp_subclasses */
2173  0, /* tp_weaklist */
2174 #endif
2175 #if PY_VERSION_HEX >= 0x02030000
2176  0, /* tp_del */
2177 #endif
2178 #if PY_VERSION_HEX >= 0x02060000
2179  0, /* tp_version_tag */
2180 #endif
2181 #if PY_VERSION_HEX >= 0x03040000
2182  0, /* tp_finalize */
2183 #endif
2184 #ifdef COUNT_ALLOCS
2185  0, /* tp_allocs */
2186  0, /* tp_frees */
2187  0, /* tp_maxalloc */
2188 #if PY_VERSION_HEX >= 0x02050000
2189  0, /* tp_prev */
2190 #endif
2191  0 /* tp_next */
2192 #endif
2193  };
2194  swigpypacked_type = tmp;
2195  type_init = 1;
2196 #if PY_VERSION_HEX < 0x02020000
2197  swigpypacked_type.ob_type = &PyType_Type;
2198 #else
2199  if (PyType_Ready(&swigpypacked_type) < 0)
2200  return NULL;
2201 #endif
2202  }
2203  return &swigpypacked_type;
2204 }
2205 
2206 SWIGRUNTIME PyObject *
2207 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2208 {
2209  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2210  if (sobj) {
2211  void *pack = malloc(size);
2212  if (pack) {
2213  memcpy(pack, ptr, size);
2214  sobj->pack = pack;
2215  sobj->ty = ty;
2216  sobj->size = size;
2217  } else {
2218  PyObject_DEL((PyObject *) sobj);
2219  sobj = 0;
2220  }
2221  }
2222  return (PyObject *) sobj;
2223 }
2224 
2225 SWIGRUNTIME swig_type_info *
2226 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2227 {
2228  if (SwigPyPacked_Check(obj)) {
2229  SwigPyPacked *sobj = (SwigPyPacked *)obj;
2230  if (sobj->size != size) return 0;
2231  memcpy(ptr, sobj->pack, size);
2232  return sobj->ty;
2233  } else {
2234  return 0;
2235  }
2236 }
2237 
2238 /* -----------------------------------------------------------------------------
2239  * pointers/data manipulation
2240  * ----------------------------------------------------------------------------- */
2241 
2242 SWIGRUNTIMEINLINE PyObject *
2243 _SWIG_This(void)
2244 {
2245  return SWIG_Python_str_FromChar("this");
2246 }
2247 
2248 static PyObject *swig_this = NULL;
2249 
2250 SWIGRUNTIME PyObject *
2251 SWIG_This(void)
2252 {
2253  if (swig_this == NULL)
2254  swig_this = _SWIG_This();
2255  return swig_this;
2256 }
2257 
2258 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2259 
2260 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2261 #if PY_VERSION_HEX>=0x03000000
2262 #define SWIG_PYTHON_SLOW_GETSET_THIS
2263 #endif
2264 
2265 SWIGRUNTIME SwigPyObject *
2266 SWIG_Python_GetSwigThis(PyObject *pyobj)
2267 {
2268  PyObject *obj;
2269 
2270  if (SwigPyObject_Check(pyobj))
2271  return (SwigPyObject *) pyobj;
2272 
2273 #ifdef SWIGPYTHON_BUILTIN
2274  (void)obj;
2275 # ifdef PyWeakref_CheckProxy
2276  if (PyWeakref_CheckProxy(pyobj)) {
2277  pyobj = PyWeakref_GET_OBJECT(pyobj);
2278  if (pyobj && SwigPyObject_Check(pyobj))
2279  return (SwigPyObject*) pyobj;
2280  }
2281 # endif
2282  return NULL;
2283 #else
2284 
2285  obj = 0;
2286 
2287 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2288  if (PyInstance_Check(pyobj)) {
2289  obj = _PyInstance_Lookup(pyobj, SWIG_This());
2290  } else {
2291  PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2292  if (dictptr != NULL) {
2293  PyObject *dict = *dictptr;
2294  obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2295  } else {
2296 #ifdef PyWeakref_CheckProxy
2297  if (PyWeakref_CheckProxy(pyobj)) {
2298  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2299  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2300  }
2301 #endif
2302  obj = PyObject_GetAttr(pyobj,SWIG_This());
2303  if (obj) {
2304  Py_DECREF(obj);
2305  } else {
2306  if (PyErr_Occurred()) PyErr_Clear();
2307  return 0;
2308  }
2309  }
2310  }
2311 #else
2312  obj = PyObject_GetAttr(pyobj,SWIG_This());
2313  if (obj) {
2314  Py_DECREF(obj);
2315  } else {
2316  if (PyErr_Occurred()) PyErr_Clear();
2317  return 0;
2318  }
2319 #endif
2320  if (obj && !SwigPyObject_Check(obj)) {
2321  /* a PyObject is called 'this', try to get the 'real this'
2322  SwigPyObject from it */
2323  return SWIG_Python_GetSwigThis(obj);
2324  }
2325  return (SwigPyObject *)obj;
2326 #endif
2327 }
2328 
2329 /* Acquire a pointer value */
2330 
2331 SWIGRUNTIME int
2332 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2333  if (own == SWIG_POINTER_OWN) {
2334  SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2335  if (sobj) {
2336  int oldown = sobj->own;
2337  sobj->own = own;
2338  return oldown;
2339  }
2340  }
2341  return 0;
2342 }
2343 
2344 /* Convert a pointer value */
2345 
2346 SWIGRUNTIME int
2347 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2348  int res;
2349  SwigPyObject *sobj;
2350  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2351 
2352  if (!obj)
2353  return SWIG_ERROR;
2354  if (obj == Py_None && !implicit_conv) {
2355  if (ptr)
2356  *ptr = 0;
2357  return SWIG_OK;
2358  }
2359 
2360  res = SWIG_ERROR;
2361 
2362  sobj = SWIG_Python_GetSwigThis(obj);
2363  if (own)
2364  *own = 0;
2365  while (sobj) {
2366  void *vptr = sobj->ptr;
2367  if (ty) {
2368  swig_type_info *to = sobj->ty;
2369  if (to == ty) {
2370  /* no type cast needed */
2371  if (ptr) *ptr = vptr;
2372  break;
2373  } else {
2374  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2375  if (!tc) {
2376  sobj = (SwigPyObject *)sobj->next;
2377  } else {
2378  if (ptr) {
2379  int newmemory = 0;
2380  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2381  if (newmemory == SWIG_CAST_NEW_MEMORY) {
2382  assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2383  if (own)
2384  *own = *own | SWIG_CAST_NEW_MEMORY;
2385  }
2386  }
2387  break;
2388  }
2389  }
2390  } else {
2391  if (ptr) *ptr = vptr;
2392  break;
2393  }
2394  }
2395  if (sobj) {
2396  if (own)
2397  *own = *own | sobj->own;
2398  if (flags & SWIG_POINTER_DISOWN) {
2399  sobj->own = 0;
2400  }
2401  res = SWIG_OK;
2402  } else {
2403  if (implicit_conv) {
2404  SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2405  if (data && !data->implicitconv) {
2406  PyObject *klass = data->klass;
2407  if (klass) {
2408  PyObject *impconv;
2409  data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2410  impconv = SWIG_Python_CallFunctor(klass, obj);
2411  data->implicitconv = 0;
2412  if (PyErr_Occurred()) {
2413  PyErr_Clear();
2414  impconv = 0;
2415  }
2416  if (impconv) {
2417  SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2418  if (iobj) {
2419  void *vptr;
2420  res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2421  if (SWIG_IsOK(res)) {
2422  if (ptr) {
2423  *ptr = vptr;
2424  /* transfer the ownership to 'ptr' */
2425  iobj->own = 0;
2426  res = SWIG_AddCast(res);
2427  res = SWIG_AddNewMask(res);
2428  } else {
2429  res = SWIG_AddCast(res);
2430  }
2431  }
2432  }
2433  Py_DECREF(impconv);
2434  }
2435  }
2436  }
2437  }
2438  if (!SWIG_IsOK(res) && obj == Py_None) {
2439  if (ptr)
2440  *ptr = 0;
2441  if (PyErr_Occurred())
2442  PyErr_Clear();
2443  res = SWIG_OK;
2444  }
2445  }
2446  return res;
2447 }
2448 
2449 /* Convert a function ptr value */
2450 
2451 SWIGRUNTIME int
2452 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2453  if (!PyCFunction_Check(obj)) {
2454  return SWIG_ConvertPtr(obj, ptr, ty, 0);
2455  } else {
2456  void *vptr = 0;
2457 
2458  /* here we get the method pointer for callbacks */
2459  const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2460  const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2461  if (desc)
2462  desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2463  if (!desc)
2464  return SWIG_ERROR;
2465  if (ty) {
2466  swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2467  if (tc) {
2468  int newmemory = 0;
2469  *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2470  assert(!newmemory); /* newmemory handling not yet implemented */
2471  } else {
2472  return SWIG_ERROR;
2473  }
2474  } else {
2475  *ptr = vptr;
2476  }
2477  return SWIG_OK;
2478  }
2479 }
2480 
2481 /* Convert a packed value value */
2482 
2483 SWIGRUNTIME int
2484 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2485  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2486  if (!to) return SWIG_ERROR;
2487  if (ty) {
2488  if (to != ty) {
2489  /* check type cast? */
2490  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2491  if (!tc) return SWIG_ERROR;
2492  }
2493  }
2494  return SWIG_OK;
2495 }
2496 
2497 /* -----------------------------------------------------------------------------
2498  * Create a new pointer object
2499  * ----------------------------------------------------------------------------- */
2500 
2501 /*
2502  Create a new instance object, without calling __init__, and set the
2503  'this' attribute.
2504 */
2505 
2506 SWIGRUNTIME PyObject*
2507 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2508 {
2509 #if (PY_VERSION_HEX >= 0x02020000)
2510  PyObject *inst = 0;
2511  PyObject *newraw = data->newraw;
2512  if (newraw) {
2513  inst = PyObject_Call(newraw, data->newargs, NULL);
2514  if (inst) {
2515 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2516  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2517  if (dictptr != NULL) {
2518  PyObject *dict = *dictptr;
2519  if (dict == NULL) {
2520  dict = PyDict_New();
2521  *dictptr = dict;
2522  PyDict_SetItem(dict, SWIG_This(), swig_this);
2523  }
2524  }
2525 #else
2526  PyObject *key = SWIG_This();
2527  PyObject_SetAttr(inst, key, swig_this);
2528 #endif
2529  }
2530  } else {
2531 #if PY_VERSION_HEX >= 0x03000000
2532  inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2533  if (inst) {
2534  PyObject_SetAttr(inst, SWIG_This(), swig_this);
2535  Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2536  }
2537 #else
2538  PyObject *dict = PyDict_New();
2539  if (dict) {
2540  PyDict_SetItem(dict, SWIG_This(), swig_this);
2541  inst = PyInstance_NewRaw(data->newargs, dict);
2542  Py_DECREF(dict);
2543  }
2544 #endif
2545  }
2546  return inst;
2547 #else
2548 #if (PY_VERSION_HEX >= 0x02010000)
2549  PyObject *inst = 0;
2550  PyObject *dict = PyDict_New();
2551  if (dict) {
2552  PyDict_SetItem(dict, SWIG_This(), swig_this);
2553  inst = PyInstance_NewRaw(data->newargs, dict);
2554  Py_DECREF(dict);
2555  }
2556  return (PyObject *) inst;
2557 #else
2558  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2559  if (inst == NULL) {
2560  return NULL;
2561  }
2562  inst->in_class = (PyClassObject *)data->newargs;
2563  Py_INCREF(inst->in_class);
2564  inst->in_dict = PyDict_New();
2565  if (inst->in_dict == NULL) {
2566  Py_DECREF(inst);
2567  return NULL;
2568  }
2569 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2570  inst->in_weakreflist = NULL;
2571 #endif
2572 #ifdef Py_TPFLAGS_GC
2573  PyObject_GC_Init(inst);
2574 #endif
2575  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2576  return (PyObject *) inst;
2577 #endif
2578 #endif
2579 }
2580 
2581 SWIGRUNTIME void
2582 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2583 {
2584  PyObject *dict;
2585 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2586  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2587  if (dictptr != NULL) {
2588  dict = *dictptr;
2589  if (dict == NULL) {
2590  dict = PyDict_New();
2591  *dictptr = dict;
2592  }
2593  PyDict_SetItem(dict, SWIG_This(), swig_this);
2594  return;
2595  }
2596 #endif
2597  dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2598  PyDict_SetItem(dict, SWIG_This(), swig_this);
2599  Py_DECREF(dict);
2600 }
2601 
2602 
2603 SWIGINTERN PyObject *
2604 SWIG_Python_InitShadowInstance(PyObject *args) {
2605  PyObject *obj[2];
2606  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2607  return NULL;
2608  } else {
2609  SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2610  if (sthis) {
2611  SwigPyObject_append((PyObject*) sthis, obj[1]);
2612  } else {
2613  SWIG_Python_SetSwigThis(obj[0], obj[1]);
2614  }
2615  return SWIG_Py_Void();
2616  }
2617 }
2618 
2619 /* Create a new pointer object */
2620 
2621 SWIGRUNTIME PyObject *
2622 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2623  SwigPyClientData *clientdata;
2624  PyObject * robj;
2625  int own;
2626 
2627  if (!ptr)
2628  return SWIG_Py_Void();
2629 
2630  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2631  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2632  if (clientdata && clientdata->pytype) {
2633  SwigPyObject *newobj;
2634  if (flags & SWIG_BUILTIN_TP_INIT) {
2635  newobj = (SwigPyObject*) self;
2636  if (newobj->ptr) {
2637  PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2638  while (newobj->next)
2639  newobj = (SwigPyObject *) newobj->next;
2640  newobj->next = next_self;
2641  newobj = (SwigPyObject *)next_self;
2642 #ifdef SWIGPYTHON_BUILTIN
2643  newobj->dict = 0;
2644 #endif
2645  }
2646  } else {
2647  newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2648 #ifdef SWIGPYTHON_BUILTIN
2649  newobj->dict = 0;
2650 #endif
2651  }
2652  if (newobj) {
2653  newobj->ptr = ptr;
2654  newobj->ty = type;
2655  newobj->own = own;
2656  newobj->next = 0;
2657  return (PyObject*) newobj;
2658  }
2659  return SWIG_Py_Void();
2660  }
2661 
2662  assert(!(flags & SWIG_BUILTIN_TP_INIT));
2663 
2664  robj = SwigPyObject_New(ptr, type, own);
2665  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2666  PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2667  Py_DECREF(robj);
2668  robj = inst;
2669  }
2670  return robj;
2671 }
2672 
2673 /* Create a new packed object */
2674 
2675 SWIGRUNTIMEINLINE PyObject *
2676 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2677  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2678 }
2679 
2680 /* -----------------------------------------------------------------------------*
2681  * Get type list
2682  * -----------------------------------------------------------------------------*/
2683 
2684 #ifdef SWIG_LINK_RUNTIME
2685 void *SWIG_ReturnGlobalTypeList(void *);
2686 #endif
2687 
2688 SWIGRUNTIME swig_module_info *
2689 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2690  static void *type_pointer = (void *)0;
2691  /* first check if module already created */
2692  if (!type_pointer) {
2693 #ifdef SWIG_LINK_RUNTIME
2694  type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2695 #else
2696 # ifdef SWIGPY_USE_CAPSULE
2697  type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2698 # else
2699  type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2700  (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2701 # endif
2702  if (PyErr_Occurred()) {
2703  PyErr_Clear();
2704  type_pointer = (void *)0;
2705  }
2706 #endif
2707  }
2708  return (swig_module_info *) type_pointer;
2709 }
2710 
2711 #if PY_MAJOR_VERSION < 2
2712 /* PyModule_AddObject function was introduced in Python 2.0. The following function
2713  is copied out of Python/modsupport.c in python version 2.3.4 */
2714 SWIGINTERN int
2715 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2716 {
2717  PyObject *dict;
2718  if (!PyModule_Check(m)) {
2719  PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
2720  return SWIG_ERROR;
2721  }
2722  if (!o) {
2723  PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
2724  return SWIG_ERROR;
2725  }
2726 
2727  dict = PyModule_GetDict(m);
2728  if (dict == NULL) {
2729  /* Internal error -- modules must have a dict! */
2730  PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2731  PyModule_GetName(m));
2732  return SWIG_ERROR;
2733  }
2734  if (PyDict_SetItemString(dict, name, o))
2735  return SWIG_ERROR;
2736  Py_DECREF(o);
2737  return SWIG_OK;
2738 }
2739 #endif
2740 
2741 SWIGRUNTIME void
2742 #ifdef SWIGPY_USE_CAPSULE
2743 SWIG_Python_DestroyModule(PyObject *obj)
2744 #else
2745 SWIG_Python_DestroyModule(void *vptr)
2746 #endif
2747 {
2748 #ifdef SWIGPY_USE_CAPSULE
2749  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2750 #else
2751  swig_module_info *swig_module = (swig_module_info *) vptr;
2752 #endif
2753  swig_type_info **types = swig_module->types;
2754  size_t i;
2755  for (i =0; i < swig_module->size; ++i) {
2756  swig_type_info *ty = types[i];
2757  if (ty->owndata) {
2758  SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2759  if (data) SwigPyClientData_Del(data);
2760  }
2761  }
2762  Py_DECREF(SWIG_This());
2763  swig_this = NULL;
2764 }
2765 
2766 SWIGRUNTIME void
2767 SWIG_Python_SetModule(swig_module_info *swig_module) {
2768 #if PY_VERSION_HEX >= 0x03000000
2769  /* Add a dummy module object into sys.modules */
2770  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2771 #else
2772  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2773  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2774 #endif
2775 #ifdef SWIGPY_USE_CAPSULE
2776  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2777  if (pointer && module) {
2778  PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2779  } else {
2780  Py_XDECREF(pointer);
2781  }
2782 #else
2783  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2784  if (pointer && module) {
2785  PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2786  } else {
2787  Py_XDECREF(pointer);
2788  }
2789 #endif
2790 }
2791 
2792 /* The python cached type query */
2793 SWIGRUNTIME PyObject *
2794 SWIG_Python_TypeCache(void) {
2795  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2796  return cache;
2797 }
2798 
2799 SWIGRUNTIME swig_type_info *
2800 SWIG_Python_TypeQuery(const char *type)
2801 {
2802  PyObject *cache = SWIG_Python_TypeCache();
2803  PyObject *key = SWIG_Python_str_FromChar(type);
2804  PyObject *obj = PyDict_GetItem(cache, key);
2805  swig_type_info *descriptor;
2806  if (obj) {
2807 #ifdef SWIGPY_USE_CAPSULE
2808  descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2809 #else
2810  descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2811 #endif
2812  } else {
2813  swig_module_info *swig_module = SWIG_GetModule(0);
2814  descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2815  if (descriptor) {
2816 #ifdef SWIGPY_USE_CAPSULE
2817  obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2818 #else
2819  obj = PyCObject_FromVoidPtr(descriptor, NULL);
2820 #endif
2821  PyDict_SetItem(cache, key, obj);
2822  Py_DECREF(obj);
2823  }
2824  }
2825  Py_DECREF(key);
2826  return descriptor;
2827 }
2828 
2829 /*
2830  For backward compatibility only
2831 */
2832 #define SWIG_POINTER_EXCEPTION 0
2833 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2834 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2835 
2836 SWIGRUNTIME int
2837 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2838 {
2839  if (PyErr_Occurred()) {
2840  PyObject *type = 0;
2841  PyObject *value = 0;
2842  PyObject *traceback = 0;
2843  PyErr_Fetch(&type, &value, &traceback);
2844  if (value) {
2845  char *tmp;
2846  PyObject *old_str = PyObject_Str(value);
2847  Py_XINCREF(type);
2848  PyErr_Clear();
2849  if (infront) {
2850  PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2851  } else {
2852  PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2853  }
2854  SWIG_Python_str_DelForPy3(tmp);
2855  Py_DECREF(old_str);
2856  }
2857  return 1;
2858  } else {
2859  return 0;
2860  }
2861 }
2862 
2863 SWIGRUNTIME int
2864 SWIG_Python_ArgFail(int argnum)
2865 {
2866  if (PyErr_Occurred()) {
2867  /* add information about failing argument */
2868  char mesg[256];
2869  PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2870  return SWIG_Python_AddErrMesg(mesg, 1);
2871  } else {
2872  return 0;
2873  }
2874 }
2875 
2876 SWIGRUNTIMEINLINE const char *
2877 SwigPyObject_GetDesc(PyObject *self)
2878 {
2879  SwigPyObject *v = (SwigPyObject *)self;
2880  swig_type_info *ty = v ? v->ty : 0;
2881  return ty ? ty->str : "";
2882 }
2883 
2884 SWIGRUNTIME void
2885 SWIG_Python_TypeError(const char *type, PyObject *obj)
2886 {
2887  if (type) {
2888 #if defined(SWIG_COBJECT_TYPES)
2889  if (obj && SwigPyObject_Check(obj)) {
2890  const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2891  if (otype) {
2892  PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2893  type, otype);
2894  return;
2895  }
2896  } else
2897 #endif
2898  {
2899  const char *otype = (obj ? obj->ob_type->tp_name : 0);
2900  if (otype) {
2901  PyObject *str = PyObject_Str(obj);
2902  const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2903  if (cstr) {
2904  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2905  type, otype, cstr);
2906  SWIG_Python_str_DelForPy3(cstr);
2907  } else {
2908  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2909  type, otype);
2910  }
2911  Py_XDECREF(str);
2912  return;
2913  }
2914  }
2915  PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2916  } else {
2917  PyErr_Format(PyExc_TypeError, "unexpected type is received");
2918  }
2919 }
2920 
2921 
2922 /* Convert a pointer value, signal an exception on a type mismatch */
2923 SWIGRUNTIME void *
2924 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2925  void *result;
2926  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2927  PyErr_Clear();
2928 #if SWIG_POINTER_EXCEPTION
2929  if (flags) {
2930  SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2931  SWIG_Python_ArgFail(argnum);
2932  }
2933 #endif
2934  }
2935  return result;
2936 }
2937 
2938 #ifdef SWIGPYTHON_BUILTIN
2939 SWIGRUNTIME int
2940 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2941  PyTypeObject *tp = obj->ob_type;
2942  PyObject *descr;
2943  PyObject *encoded_name;
2944  descrsetfunc f;
2945  int res = -1;
2946 
2947 # ifdef Py_USING_UNICODE
2948  if (PyString_Check(name)) {
2949  name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2950  if (!name)
2951  return -1;
2952  } else if (!PyUnicode_Check(name))
2953 # else
2954  if (!PyString_Check(name))
2955 # endif
2956  {
2957  PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2958  return -1;
2959  } else {
2960  Py_INCREF(name);
2961  }
2962 
2963  if (!tp->tp_dict) {
2964  if (PyType_Ready(tp) < 0)
2965  goto done;
2966  }
2967 
2968  descr = _PyType_Lookup(tp, name);
2969  f = NULL;
2970  if (descr != NULL)
2971  f = descr->ob_type->tp_descr_set;
2972  if (!f) {
2973  if (PyString_Check(name)) {
2974  encoded_name = name;
2975  Py_INCREF(name);
2976  } else {
2977  encoded_name = PyUnicode_AsUTF8String(name);
2978  }
2979  PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2980  Py_DECREF(encoded_name);
2981  } else {
2982  res = f(descr, obj, value);
2983  }
2984 
2985  done:
2986  Py_DECREF(name);
2987  return res;
2988 }
2989 #endif
2990 
2991 
2992 #ifdef __cplusplus
2993 }
2994 #endif
2995 
2996 
2997 
2998 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2999 
3000 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
3001 
3002 
3003 
3004 /* -------- TYPES TABLE (BEGIN) -------- */
3005 
3006 #define SWIGTYPE_p_Crev swig_types[0]
3007 #define SWIGTYPE_p_FILE swig_types[1]
3008 #define SWIGTYPE_p_MapLong2Long swig_types[2]
3009 #define SWIGTYPE_p_Node swig_types[3]
3010 #define SWIGTYPE_p_T swig_types[4]
3011 #define SWIGTYPE_p_TI swig_types[5]
3012 #define SWIGTYPE_p_char swig_types[6]
3013 #define SWIGTYPE_p_component_t swig_types[7]
3014 #define SWIGTYPE_p_distance_t swig_types[8]
3015 #define SWIGTYPE_p_double swig_types[9]
3016 #define SWIGTYPE_p_faiss__ArrayInvertedLists swig_types[10]
3017 #define SWIGTYPE_p_faiss__AutoTuneCriterion swig_types[11]
3018 #define SWIGTYPE_p_faiss__BinaryInvertedListScanner swig_types[12]
3019 #define SWIGTYPE_p_faiss__BufferList swig_types[13]
3020 #define SWIGTYPE_p_faiss__CenteringTransform swig_types[14]
3021 #define SWIGTYPE_p_faiss__Cloner swig_types[15]
3022 #define SWIGTYPE_p_faiss__Clustering swig_types[16]
3023 #define SWIGTYPE_p_faiss__ClusteringParameters swig_types[17]
3024 #define SWIGTYPE_p_faiss__ConcatenatedInvertedLists swig_types[18]
3025 #define SWIGTYPE_p_faiss__DistanceComputer swig_types[19]
3026 #define SWIGTYPE_p_faiss__GenHammingComputer16 swig_types[20]
3027 #define SWIGTYPE_p_faiss__GenHammingComputer32 swig_types[21]
3028 #define SWIGTYPE_p_faiss__GenHammingComputer8 swig_types[22]
3029 #define SWIGTYPE_p_faiss__GenHammingComputerM8 swig_types[23]
3030 #define SWIGTYPE_p_faiss__HNSW swig_types[24]
3031 #define SWIGTYPE_p_faiss__HNSWStats swig_types[25]
3032 #define SWIGTYPE_p_faiss__HNSW__MinimaxHeap swig_types[26]
3033 #define SWIGTYPE_p_faiss__HammingComputer16 swig_types[27]
3034 #define SWIGTYPE_p_faiss__HammingComputer20 swig_types[28]
3035 #define SWIGTYPE_p_faiss__HammingComputer32 swig_types[29]
3036 #define SWIGTYPE_p_faiss__HammingComputer4 swig_types[30]
3037 #define SWIGTYPE_p_faiss__HammingComputer64 swig_types[31]
3038 #define SWIGTYPE_p_faiss__HammingComputer8 swig_types[32]
3039 #define SWIGTYPE_p_faiss__HammingComputerDefault swig_types[33]
3040 #define SWIGTYPE_p_faiss__HammingComputerM4 swig_types[34]
3041 #define SWIGTYPE_p_faiss__HammingComputerM8 swig_types[35]
3042 #define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t swig_types[36]
3043 #define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t swig_types[37]
3044 #define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t swig_types[38]
3045 #define SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_int_long_t_t swig_types[39]
3046 #define SWIGTYPE_p_faiss__IDSelector swig_types[40]
3047 #define SWIGTYPE_p_faiss__IDSelectorBatch swig_types[41]
3048 #define SWIGTYPE_p_faiss__IDSelectorRange swig_types[42]
3049 #define SWIGTYPE_p_faiss__IOReader swig_types[43]
3050 #define SWIGTYPE_p_faiss__IOWriter swig_types[44]
3051 #define SWIGTYPE_p_faiss__IVFPQSearchParameters swig_types[45]
3052 #define SWIGTYPE_p_faiss__IVFSearchParameters swig_types[46]
3053 #define SWIGTYPE_p_faiss__Index swig_types[47]
3054 #define SWIGTYPE_p_faiss__Index2Layer swig_types[48]
3055 #define SWIGTYPE_p_faiss__IndexBinary swig_types[49]
3056 #define SWIGTYPE_p_faiss__IndexBinaryFlat swig_types[50]
3057 #define SWIGTYPE_p_faiss__IndexBinaryFromFloat swig_types[51]
3058 #define SWIGTYPE_p_faiss__IndexBinaryHNSW swig_types[52]
3059 #define SWIGTYPE_p_faiss__IndexBinaryIVF swig_types[53]
3060 #define SWIGTYPE_p_faiss__IndexFlat swig_types[54]
3061 #define SWIGTYPE_p_faiss__IndexFlat1D swig_types[55]
3062 #define SWIGTYPE_p_faiss__IndexFlatIP swig_types[56]
3063 #define SWIGTYPE_p_faiss__IndexFlatL2 swig_types[57]
3064 #define SWIGTYPE_p_faiss__IndexFlatL2BaseShift swig_types[58]
3065 #define SWIGTYPE_p_faiss__IndexHNSW swig_types[59]
3066 #define SWIGTYPE_p_faiss__IndexHNSW2Level swig_types[60]
3067 #define SWIGTYPE_p_faiss__IndexHNSWFlat swig_types[61]
3068 #define SWIGTYPE_p_faiss__IndexHNSWPQ swig_types[62]
3069 #define SWIGTYPE_p_faiss__IndexHNSWSQ swig_types[63]
3070 #define SWIGTYPE_p_faiss__IndexIDMap swig_types[64]
3071 #define SWIGTYPE_p_faiss__IndexIDMap2 swig_types[65]
3072 #define SWIGTYPE_p_faiss__IndexIVF swig_types[66]
3073 #define SWIGTYPE_p_faiss__IndexIVFFlat swig_types[67]
3074 #define SWIGTYPE_p_faiss__IndexIVFFlatDedup swig_types[68]
3075 #define SWIGTYPE_p_faiss__IndexIVFPQ swig_types[69]
3076 #define SWIGTYPE_p_faiss__IndexIVFPQR swig_types[70]
3077 #define SWIGTYPE_p_faiss__IndexIVFPQStats swig_types[71]
3078 #define SWIGTYPE_p_faiss__IndexIVFScalarQuantizer swig_types[72]
3079 #define SWIGTYPE_p_faiss__IndexIVFStats swig_types[73]
3080 #define SWIGTYPE_p_faiss__IndexLSH swig_types[74]
3081 #define SWIGTYPE_p_faiss__IndexPQ swig_types[75]
3082 #define SWIGTYPE_p_faiss__IndexPQStats swig_types[76]
3083 #define SWIGTYPE_p_faiss__IndexPreTransform swig_types[77]
3084 #define SWIGTYPE_p_faiss__IndexRefineFlat swig_types[78]
3085 #define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__IndexBinary_t swig_types[79]
3086 #define SWIGTYPE_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[80]
3087 #define SWIGTYPE_p_faiss__IndexScalarQuantizer swig_types[81]
3088 #define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__IndexBinary_t swig_types[82]
3089 #define SWIGTYPE_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[83]
3090 #define SWIGTYPE_p_faiss__IndexSplitVectors swig_types[84]
3091 #define SWIGTYPE_p_faiss__InterruptCallback swig_types[85]
3092 #define SWIGTYPE_p_faiss__IntersectionCriterion swig_types[86]
3093 #define SWIGTYPE_p_faiss__InvertedListScanner swig_types[87]
3094 #define SWIGTYPE_p_faiss__InvertedLists swig_types[88]
3095 #define SWIGTYPE_p_faiss__Level1Quantizer swig_types[89]
3096 #define SWIGTYPE_p_faiss__LinearTransform swig_types[90]
3097 #define SWIGTYPE_p_faiss__LockLevels swig_types[91]
3098 #define SWIGTYPE_p_faiss__MatrixStats swig_types[92]
3099 #define SWIGTYPE_p_faiss__MultiIndexQuantizer swig_types[93]
3100 #define SWIGTYPE_p_faiss__MultiIndexQuantizer2 swig_types[94]
3101 #define SWIGTYPE_p_faiss__NormalizationTransform swig_types[95]
3102 #define SWIGTYPE_p_faiss__OPQMatrix swig_types[96]
3103 #define SWIGTYPE_p_faiss__OnDiskInvertedLists swig_types[97]
3104 #define SWIGTYPE_p_faiss__OnDiskInvertedLists__OngoingPrefetch swig_types[98]
3105 #define SWIGTYPE_p_faiss__OneRecallAtRCriterion swig_types[99]
3106 #define SWIGTYPE_p_faiss__OperatingPoint swig_types[100]
3107 #define SWIGTYPE_p_faiss__OperatingPoints swig_types[101]
3108 #define SWIGTYPE_p_faiss__PCAMatrix swig_types[102]
3109 #define SWIGTYPE_p_faiss__ParameterRange swig_types[103]
3110 #define SWIGTYPE_p_faiss__ParameterSpace swig_types[104]
3111 #define SWIGTYPE_p_faiss__PermutationObjective swig_types[105]
3112 #define SWIGTYPE_p_faiss__PolysemousTraining swig_types[106]
3113 #define SWIGTYPE_p_faiss__ProductQuantizer swig_types[107]
3114 #define SWIGTYPE_p_faiss__RandomGenerator swig_types[108]
3115 #define SWIGTYPE_p_faiss__RandomRotationMatrix swig_types[109]
3116 #define SWIGTYPE_p_faiss__RangeQueryResult swig_types[110]
3117 #define SWIGTYPE_p_faiss__RangeSearchPartialResult swig_types[111]
3118 #define SWIGTYPE_p_faiss__RangeSearchResult swig_types[112]
3119 #define SWIGTYPE_p_faiss__ReconstructFromNeighbors swig_types[113]
3120 #define SWIGTYPE_p_faiss__RemapDimensionsTransform swig_types[114]
3121 #define SWIGTYPE_p_faiss__ReproduceDistancesObjective swig_types[115]
3122 #define SWIGTYPE_p_faiss__SQDistanceComputer swig_types[116]
3123 #define SWIGTYPE_p_faiss__ScalarQuantizer swig_types[117]
3124 #define SWIGTYPE_p_faiss__SimulatedAnnealingOptimizer swig_types[118]
3125 #define SWIGTYPE_p_faiss__SimulatedAnnealingParameters swig_types[119]
3126 #define SWIGTYPE_p_faiss__VectorIOReader swig_types[120]
3127 #define SWIGTYPE_p_faiss__VectorIOWriter swig_types[121]
3128 #define SWIGTYPE_p_faiss__VectorTransform swig_types[122]
3129 #define SWIGTYPE_p_faiss__VisitedTable swig_types[123]
3130 #define SWIGTYPE_p_faiss__ivflib__SlidingIndexWindow swig_types[124]
3131 #define SWIGTYPE_p_float swig_types[125]
3132 #define SWIGTYPE_p_idx_t swig_types[126]
3133 #define SWIGTYPE_p_int swig_types[127]
3134 #define SWIGTYPE_p_long swig_types[128]
3135 #define SWIGTYPE_p_omp_lock_t swig_types[129]
3136 #define SWIGTYPE_p_p_faiss__ArrayInvertedLists swig_types[130]
3137 #define SWIGTYPE_p_p_faiss__CenteringTransform swig_types[131]
3138 #define SWIGTYPE_p_p_faiss__ConcatenatedInvertedLists swig_types[132]
3139 #define SWIGTYPE_p_p_faiss__Index swig_types[133]
3140 #define SWIGTYPE_p_p_faiss__Index2Layer swig_types[134]
3141 #define SWIGTYPE_p_p_faiss__IndexFlat swig_types[135]
3142 #define SWIGTYPE_p_p_faiss__IndexFlat1D swig_types[136]
3143 #define SWIGTYPE_p_p_faiss__IndexFlatIP swig_types[137]
3144 #define SWIGTYPE_p_p_faiss__IndexFlatL2 swig_types[138]
3145 #define SWIGTYPE_p_p_faiss__IndexFlatL2BaseShift swig_types[139]
3146 #define SWIGTYPE_p_p_faiss__IndexHNSW swig_types[140]
3147 #define SWIGTYPE_p_p_faiss__IndexHNSW2Level swig_types[141]
3148 #define SWIGTYPE_p_p_faiss__IndexHNSWFlat swig_types[142]
3149 #define SWIGTYPE_p_p_faiss__IndexHNSWPQ swig_types[143]
3150 #define SWIGTYPE_p_p_faiss__IndexHNSWSQ swig_types[144]
3151 #define SWIGTYPE_p_p_faiss__IndexIDMap swig_types[145]
3152 #define SWIGTYPE_p_p_faiss__IndexIDMap2 swig_types[146]
3153 #define SWIGTYPE_p_p_faiss__IndexIVF swig_types[147]
3154 #define SWIGTYPE_p_p_faiss__IndexIVFFlat swig_types[148]
3155 #define SWIGTYPE_p_p_faiss__IndexIVFFlatDedup swig_types[149]
3156 #define SWIGTYPE_p_p_faiss__IndexIVFPQ swig_types[150]
3157 #define SWIGTYPE_p_p_faiss__IndexIVFPQR swig_types[151]
3158 #define SWIGTYPE_p_p_faiss__IndexIVFScalarQuantizer swig_types[152]
3159 #define SWIGTYPE_p_p_faiss__IndexLSH swig_types[153]
3160 #define SWIGTYPE_p_p_faiss__IndexPQ swig_types[154]
3161 #define SWIGTYPE_p_p_faiss__IndexPreTransform swig_types[155]
3162 #define SWIGTYPE_p_p_faiss__IndexRefineFlat swig_types[156]
3163 #define SWIGTYPE_p_p_faiss__IndexReplicasTemplateT_faiss__Index_t swig_types[157]
3164 #define SWIGTYPE_p_p_faiss__IndexScalarQuantizer swig_types[158]
3165 #define SWIGTYPE_p_p_faiss__IndexShardsTemplateT_faiss__Index_t swig_types[159]
3166 #define SWIGTYPE_p_p_faiss__IndexSplitVectors swig_types[160]
3167 #define SWIGTYPE_p_p_faiss__InvertedLists swig_types[161]
3168 #define SWIGTYPE_p_p_faiss__LinearTransform swig_types[162]
3169 #define SWIGTYPE_p_p_faiss__MultiIndexQuantizer swig_types[163]
3170 #define SWIGTYPE_p_p_faiss__MultiIndexQuantizer2 swig_types[164]
3171 #define SWIGTYPE_p_p_faiss__NormalizationTransform swig_types[165]
3172 #define SWIGTYPE_p_p_faiss__OPQMatrix swig_types[166]
3173 #define SWIGTYPE_p_p_faiss__OnDiskInvertedLists swig_types[167]
3174 #define SWIGTYPE_p_p_faiss__PCAMatrix swig_types[168]
3175 #define SWIGTYPE_p_p_faiss__RandomRotationMatrix swig_types[169]
3176 #define SWIGTYPE_p_p_faiss__RemapDimensionsTransform swig_types[170]
3177 #define SWIGTYPE_p_p_faiss__VectorTransform swig_types[171]
3178 #define SWIGTYPE_p_std__functionT_void_ffaiss__IndexBinary_pF_t swig_types[172]
3179 #define SWIGTYPE_p_std__functionT_void_ffaiss__Index_pF_t swig_types[173]
3180 #define SWIGTYPE_p_std__listT_faiss__OnDiskInvertedLists__Slot_t swig_types[174]
3181 #define SWIGTYPE_p_std__mt19937 swig_types[175]
3182 #define SWIGTYPE_p_std__pairT_float_int_t swig_types[176]
3183 #define SWIGTYPE_p_std__priority_queueT_faiss__HNSW__NodeDistFarther_t swig_types[177]
3184 #define SWIGTYPE_p_std__priority_queueT_std__pairT_float_int_t_t swig_types[178]
3185 #define SWIGTYPE_p_std__unordered_mapT_long_long_t swig_types[179]
3186 #define SWIGTYPE_p_std__unordered_mapT_unsigned_long_faiss__MatrixStats__Occurrence_t swig_types[180]
3187 #define SWIGTYPE_p_std__unordered_multimapT_long_long_t swig_types[181]
3188 #define SWIGTYPE_p_std__vectorT_char_t swig_types[182]
3189 #define SWIGTYPE_p_std__vectorT_double_t swig_types[183]
3190 #define SWIGTYPE_p_std__vectorT_faiss__BufferList__Buffer_t swig_types[184]
3191 #define SWIGTYPE_p_std__vectorT_faiss__HNSW__NodeDistFarther_t swig_types[185]
3192 #define SWIGTYPE_p_std__vectorT_faiss__IndexBinary_p_t swig_types[186]
3193 #define SWIGTYPE_p_std__vectorT_faiss__Index_p_t swig_types[187]
3194 #define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_const_p_t swig_types[188]
3195 #define SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t swig_types[189]
3196 #define SWIGTYPE_p_std__vectorT_faiss__MatrixStats__PerDimStats_t swig_types[190]
3197 #define SWIGTYPE_p_std__vectorT_faiss__OnDiskInvertedLists__List_t swig_types[191]
3198 #define SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t swig_types[192]
3199 #define SWIGTYPE_p_std__vectorT_faiss__ParameterRange_t swig_types[193]
3200 #define SWIGTYPE_p_std__vectorT_faiss__RangeQueryResult_t swig_types[194]
3201 #define SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t swig_types[195]
3202 #define SWIGTYPE_p_std__vectorT_float_t swig_types[196]
3203 #define SWIGTYPE_p_std__vectorT_int_t swig_types[197]
3204 #define SWIGTYPE_p_std__vectorT_long_t swig_types[198]
3205 #define SWIGTYPE_p_std__vectorT_omp_lock_t_t swig_types[199]
3206 #define SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t swig_types[200]
3207 #define SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t swig_types[201]
3208 #define SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t swig_types[202]
3209 #define SWIGTYPE_p_std__vectorT_std__vectorT_unsigned_long_t_t swig_types[203]
3210 #define SWIGTYPE_p_std__vectorT_unsigned_char_t swig_types[204]
3211 #define SWIGTYPE_p_std__vectorT_unsigned_long_t swig_types[205]
3212 #define SWIGTYPE_p_storage_idx_t swig_types[206]
3213 #define SWIGTYPE_p_uint32_t swig_types[207]
3214 #define SWIGTYPE_p_unsigned_char swig_types[208]
3215 #define SWIGTYPE_p_unsigned_long swig_types[209]
3216 #define SWIGTYPE_p_void swig_types[210]
3217 static swig_type_info *swig_types[212];
3218 static swig_module_info swig_module = {swig_types, 211, 0, 0, 0, 0};
3219 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3220 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3221 
3222 /* -------- TYPES TABLE (END) -------- */
3223 
3224 #if (PY_VERSION_HEX <= 0x02000000)
3225 # if !defined(SWIG_PYTHON_CLASSIC)
3226 # error "This python version requires swig to be run with the '-classic' option"
3227 # endif
3228 #endif
3229 
3230 /*-----------------------------------------------
3231  @(target):= _swigfaiss.so
3232  ------------------------------------------------*/
3233 #if PY_VERSION_HEX >= 0x03000000
3234 # define SWIG_init PyInit__swigfaiss
3235 
3236 #else
3237 # define SWIG_init init_swigfaiss
3238 
3239 #endif
3240 #define SWIG_name "_swigfaiss"
3241 
3242 #define SWIGVERSION 0x030012
3243 #define SWIG_VERSION SWIGVERSION
3244 
3245 
3246 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3247 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3248 
3249 
3250 #include <stdexcept>
3251 
3252 
3253 namespace swig {
3255  protected:
3256  PyObject *_obj;
3257 
3258  public:
3259  SwigPtr_PyObject() :_obj(0)
3260  {
3261  }
3262 
3263  SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3264  {
3265  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3266  Py_XINCREF(_obj);
3267  SWIG_PYTHON_THREAD_END_BLOCK;
3268  }
3269 
3270  SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3271  {
3272  if (initial_ref) {
3273  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3274  Py_XINCREF(_obj);
3275  SWIG_PYTHON_THREAD_END_BLOCK;
3276  }
3277  }
3278 
3279  SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3280  {
3281  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3282  Py_XINCREF(item._obj);
3283  Py_XDECREF(_obj);
3284  _obj = item._obj;
3285  SWIG_PYTHON_THREAD_END_BLOCK;
3286  return *this;
3287  }
3288 
3289  ~SwigPtr_PyObject()
3290  {
3291  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3292  Py_XDECREF(_obj);
3293  SWIG_PYTHON_THREAD_END_BLOCK;
3294  }
3295 
3296  operator PyObject *() const
3297  {
3298  return _obj;
3299  }
3300 
3301  PyObject *operator->() const
3302  {
3303  return _obj;
3304  }
3305  };
3306 }
3307 
3308 
3309 namespace swig {
3311  SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3312 
3313  SwigVar_PyObject & operator = (PyObject* obj)
3314  {
3315  Py_XDECREF(_obj);
3316  _obj = obj;
3317  return *this;
3318  }
3319  };
3320 }
3321 
3322 
3323 
3324 
3325 #include <stdint.h>
3326 #include <omp.h>
3327 
3328 
3329 #ifdef SWIGLUA
3330 
3331 #include <pthread.h>
3332 
3333 extern "C" {
3334 
3335 #include <TH/TH.h>
3336 #include <luaT.h>
3337 #undef THTensor
3338 
3339 }
3340 
3341 #endif
3342 
3343 
3344 #ifdef SWIGPYTHON
3345 
3346 #undef popcount64
3347 
3348 #define SWIG_FILE_WITH_INIT
3349 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
3350 #include <numpy/arrayobject.h>
3351 
3352 #endif
3353 
3354 
3355 #include "IndexFlat.h"
3356 #include "VectorTransform.h"
3357 #include "IndexLSH.h"
3358 #include "IndexPQ.h"
3359 #include "IndexIVF.h"
3360 #include "IndexIVFPQ.h"
3361 #include "IndexIVFFlat.h"
3362 #include "IndexScalarQuantizer.h"
3363 #include "IndexShards.h"
3364 #include "IndexReplicas.h"
3365 #include "HNSW.h"
3366 #include "IndexHNSW.h"
3367 #include "MetaIndexes.h"
3368 #include "FaissAssert.h"
3369 
3370 #include "IndexBinaryFlat.h"
3371 #include "IndexBinaryIVF.h"
3372 #include "IndexBinaryFromFloat.h"
3373 #include "IndexBinaryHNSW.h"
3374 
3375 #include "index_io.h"
3376 
3377 #include "IVFlib.h"
3378 #include "utils.h"
3379 #include "Heap.h"
3380 #include "AuxIndexStructures.h"
3381 #include "OnDiskInvertedLists.h"
3382 
3383 #include "Clustering.h"
3384 
3385 #include "hamming.h"
3386 
3387 #include "AutoTune.h"
3388 
3389 
3390 
3391 
3392 
3393 #include <float.h>
3394 
3395 
3396 #include <math.h>
3397 
3398 
3399 /* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */
3400 #ifndef SWIG_isfinite
3401 /* isfinite() is a macro for C99 */
3402 # if defined(isfinite)
3403 # define SWIG_isfinite(X) (isfinite(X))
3404 # elif defined __cplusplus && __cplusplus >= 201103L
3405 /* Use a template so that this works whether isfinite() is std::isfinite() or
3406  * in the global namespace. The reality seems to vary between compiler
3407  * versions.
3408  *
3409  * Make sure namespace std exists to avoid compiler warnings.
3410  *
3411  * extern "C++" is required as this fragment can end up inside an extern "C" { } block
3412  */
3413 namespace std { }
3414 extern "C++" template<typename T>
3415 inline int SWIG_isfinite_func(T x) {
3416  using namespace std;
3417  return isfinite(x);
3418 }
3419 # define SWIG_isfinite(X) (SWIG_isfinite_func(X))
3420 # elif defined(_MSC_VER)
3421 # define SWIG_isfinite(X) (_finite(X))
3422 # elif defined(__sun) && defined(__SVR4)
3423 # include <ieeefp.h>
3424 # define SWIG_isfinite(X) (finite(X))
3425 # endif
3426 #endif
3427 
3428 
3429 /* Accept infinite as a valid float value unless we are unable to check if a value is finite */
3430 #ifdef SWIG_isfinite
3431 # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X))
3432 #else
3433 # define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX))
3434 #endif
3435 
3436 
3437 SWIGINTERN int
3438 SWIG_AsVal_double (PyObject *obj, double *val)
3439 {
3440  int res = SWIG_TypeError;
3441  if (PyFloat_Check(obj)) {
3442  if (val) *val = PyFloat_AsDouble(obj);
3443  return SWIG_OK;
3444 #if PY_VERSION_HEX < 0x03000000
3445  } else if (PyInt_Check(obj)) {
3446  if (val) *val = (double) PyInt_AsLong(obj);
3447  return SWIG_OK;
3448 #endif
3449  } else if (PyLong_Check(obj)) {
3450  double v = PyLong_AsDouble(obj);
3451  if (!PyErr_Occurred()) {
3452  if (val) *val = v;
3453  return SWIG_OK;
3454  } else {
3455  PyErr_Clear();
3456  }
3457  }
3458 #ifdef SWIG_PYTHON_CAST_MODE
3459  {
3460  int dispatch = 0;
3461  double d = PyFloat_AsDouble(obj);
3462  if (!PyErr_Occurred()) {
3463  if (val) *val = d;
3464  return SWIG_AddCast(SWIG_OK);
3465  } else {
3466  PyErr_Clear();
3467  }
3468  if (!dispatch) {
3469  long v = PyLong_AsLong(obj);
3470  if (!PyErr_Occurred()) {
3471  if (val) *val = v;
3472  return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3473  } else {
3474  PyErr_Clear();
3475  }
3476  }
3477  }
3478 #endif
3479  return res;
3480 }
3481 
3482 
3483 SWIGINTERN int
3484 SWIG_AsVal_float (PyObject * obj, float *val)
3485 {
3486  double v;
3487  int res = SWIG_AsVal_double (obj, &v);
3488  if (SWIG_IsOK(res)) {
3489  if (SWIG_Float_Overflow_Check(v)) {
3490  return SWIG_OverflowError;
3491  } else {
3492  if (val) *val = static_cast< float >(v);
3493  }
3494  }
3495  return res;
3496 }
3497 
3498 
3499  #define SWIG_From_long PyInt_FromLong
3500 
3501 
3502 SWIGINTERNINLINE PyObject*
3503 SWIG_From_unsigned_SS_long (unsigned long value)
3504 {
3505  return (value > LONG_MAX) ?
3506  PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
3507 }
3508 
3509 
3510 #include <limits.h>
3511 #if !defined(SWIG_NO_LLONG_MAX)
3512 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3513 # define LLONG_MAX __LONG_LONG_MAX__
3514 # define LLONG_MIN (-LLONG_MAX - 1LL)
3515 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3516 # endif
3517 #endif
3518 
3519 
3520 #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
3521 # define SWIG_LONG_LONG_AVAILABLE
3522 #endif
3523 
3524 
3525 #ifdef SWIG_LONG_LONG_AVAILABLE
3526 SWIGINTERNINLINE PyObject*
3527 SWIG_From_unsigned_SS_long_SS_long (unsigned long long value)
3528 {
3529  return (value > LONG_MAX) ?
3530  PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value));
3531 }
3532 #endif
3533 
3534 
3535 SWIGINTERNINLINE PyObject *
3536 SWIG_From_size_t (size_t value)
3537 {
3538 #ifdef SWIG_LONG_LONG_AVAILABLE
3539  if (sizeof(size_t) <= sizeof(unsigned long)) {
3540 #endif
3541  return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
3542 #ifdef SWIG_LONG_LONG_AVAILABLE
3543  } else {
3544  /* assume sizeof(size_t) <= sizeof(unsigned long long) */
3545  return SWIG_From_unsigned_SS_long_SS_long (static_cast< unsigned long long >(value));
3546  }
3547 #endif
3548 }
3549 
3550 
3551 SWIGINTERNINLINE int
3552 SWIG_CanCastAsInteger(double *d, double min, double max) {
3553  double x = *d;
3554  if ((min <= x && x <= max)) {
3555  double fx = floor(x);
3556  double cx = ceil(x);
3557  double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3558  if ((errno == EDOM) || (errno == ERANGE)) {
3559  errno = 0;
3560  } else {
3561  double summ, reps, diff;
3562  if (rd < x) {
3563  diff = x - rd;
3564  } else if (rd > x) {
3565  diff = rd - x;
3566  } else {
3567  return 1;
3568  }
3569  summ = rd + x;
3570  reps = diff/summ;
3571  if (reps < 8*DBL_EPSILON) {
3572  *d = rd;
3573  return 1;
3574  }
3575  }
3576  }
3577  return 0;
3578 }
3579 
3580 
3581 SWIGINTERN int
3582 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
3583 {
3584 #if PY_VERSION_HEX < 0x03000000
3585  if (PyInt_Check(obj)) {
3586  long v = PyInt_AsLong(obj);
3587  if (v >= 0) {
3588  if (val) *val = v;
3589  return SWIG_OK;
3590  } else {
3591  return SWIG_OverflowError;
3592  }
3593  } else
3594 #endif
3595  if (PyLong_Check(obj)) {
3596  unsigned long v = PyLong_AsUnsignedLong(obj);
3597  if (!PyErr_Occurred()) {
3598  if (val) *val = v;
3599  return SWIG_OK;
3600  } else {
3601  PyErr_Clear();
3602  return SWIG_OverflowError;
3603  }
3604  }
3605 #ifdef SWIG_PYTHON_CAST_MODE
3606  {
3607  int dispatch = 0;
3608  unsigned long v = PyLong_AsUnsignedLong(obj);
3609  if (!PyErr_Occurred()) {
3610  if (val) *val = v;
3611  return SWIG_AddCast(SWIG_OK);
3612  } else {
3613  PyErr_Clear();
3614  }
3615  if (!dispatch) {
3616  double d;
3617  int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3618  if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3619  if (val) *val = (unsigned long)(d);
3620  return res;
3621  }
3622  }
3623  }
3624 #endif
3625  return SWIG_TypeError;
3626 }
3627 
3628 
3629 #ifdef SWIG_LONG_LONG_AVAILABLE
3630 SWIGINTERN int
3631 SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val)
3632 {
3633  int res = SWIG_TypeError;
3634  if (PyLong_Check(obj)) {
3635  unsigned long long v = PyLong_AsUnsignedLongLong(obj);
3636  if (!PyErr_Occurred()) {
3637  if (val) *val = v;
3638  return SWIG_OK;
3639  } else {
3640  PyErr_Clear();
3641  res = SWIG_OverflowError;
3642  }
3643  } else {
3644  unsigned long v;
3645  res = SWIG_AsVal_unsigned_SS_long (obj,&v);
3646  if (SWIG_IsOK(res)) {
3647  if (val) *val = v;
3648  return res;
3649  }
3650  }
3651 #ifdef SWIG_PYTHON_CAST_MODE
3652  {
3653  const double mant_max = 1LL << DBL_MANT_DIG;
3654  double d;
3655  res = SWIG_AsVal_double (obj,&d);
3656  if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max))
3657  return SWIG_OverflowError;
3658  if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
3659  if (val) *val = (unsigned long long)(d);
3660  return SWIG_AddCast(res);
3661  }
3662  res = SWIG_TypeError;
3663  }
3664 #endif
3665  return res;
3666 }
3667 #endif
3668 
3669 
3670 SWIGINTERNINLINE int
3671 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3672 {
3673  int res = SWIG_TypeError;
3674 #ifdef SWIG_LONG_LONG_AVAILABLE
3675  if (sizeof(size_t) <= sizeof(unsigned long)) {
3676 #endif
3677  unsigned long v;
3678  res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3679  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3680 #ifdef SWIG_LONG_LONG_AVAILABLE
3681  } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
3682  unsigned long long v;
3683  res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
3684  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3685  }
3686 #endif
3687  return res;
3688 }
3689 
3690 
3691  #define SWIG_From_double PyFloat_FromDouble
3692 
3693 
3694 SWIGINTERNINLINE PyObject *
3695 SWIG_From_float (float value)
3696 {
3697  return SWIG_From_double (value);
3698 }
3699 
3700 
3701 SWIGINTERN int
3702 SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val)
3703 {
3704  unsigned long v;
3705  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
3706  if (SWIG_IsOK(res)) {
3707  if ((v > UCHAR_MAX)) {
3708  return SWIG_OverflowError;
3709  } else {
3710  if (val) *val = static_cast< unsigned char >(v);
3711  }
3712  }
3713  return res;
3714 }
3715 
3716 
3717 SWIGINTERNINLINE PyObject *
3718 SWIG_From_unsigned_SS_char (unsigned char value)
3719 {
3720  return SWIG_From_unsigned_SS_long (value);
3721 }
3722 
3723 
3724 SWIGINTERN swig_type_info*
3725 SWIG_pchar_descriptor(void)
3726 {
3727  static int init = 0;
3728  static swig_type_info* info = 0;
3729  if (!init) {
3730  info = SWIG_TypeQuery("_p_char");
3731  init = 1;
3732  }
3733  return info;
3734 }
3735 
3736 
3737 SWIGINTERN int
3738 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3739 {
3740 #if PY_VERSION_HEX>=0x03000000
3741 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3742  if (PyBytes_Check(obj))
3743 #else
3744  if (PyUnicode_Check(obj))
3745 #endif
3746 #else
3747  if (PyString_Check(obj))
3748 #endif
3749  {
3750  char *cstr; Py_ssize_t len;
3751 #if PY_VERSION_HEX>=0x03000000
3752 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3753  if (!alloc && cptr) {
3754  /* We can't allow converting without allocation, since the internal
3755  representation of string in Python 3 is UCS-2/UCS-4 but we require
3756  a UTF-8 representation.
3757  TODO(bhy) More detailed explanation */
3758  return SWIG_RuntimeError;
3759  }
3760  obj = PyUnicode_AsUTF8String(obj);
3761  if(alloc) *alloc = SWIG_NEWOBJ;
3762 #endif
3763  PyBytes_AsStringAndSize(obj, &cstr, &len);
3764 #else
3765  PyString_AsStringAndSize(obj, &cstr, &len);
3766 #endif
3767  if (cptr) {
3768  if (alloc) {
3769  /*
3770  In python the user should not be able to modify the inner
3771  string representation. To warranty that, if you define
3772  SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
3773  buffer is always returned.
3774 
3775  The default behavior is just to return the pointer value,
3776  so, be careful.
3777  */
3778 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
3779  if (*alloc != SWIG_OLDOBJ)
3780 #else
3781  if (*alloc == SWIG_NEWOBJ)
3782 #endif
3783  {
3784  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3785  *alloc = SWIG_NEWOBJ;
3786  } else {
3787  *cptr = cstr;
3788  *alloc = SWIG_OLDOBJ;
3789  }
3790  } else {
3791 #if PY_VERSION_HEX>=0x03000000
3792 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3793  *cptr = PyBytes_AsString(obj);
3794 #else
3795  assert(0); /* Should never reach here with Unicode strings in Python 3 */
3796 #endif
3797 #else
3798  *cptr = SWIG_Python_str_AsChar(obj);
3799 #endif
3800  }
3801  }
3802  if (psize) *psize = len + 1;
3803 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3804  Py_XDECREF(obj);
3805 #endif
3806  return SWIG_OK;
3807  } else {
3808 #if defined(SWIG_PYTHON_2_UNICODE)
3809 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3810 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3811 #endif
3812 #if PY_VERSION_HEX<0x03000000
3813  if (PyUnicode_Check(obj)) {
3814  char *cstr; Py_ssize_t len;
3815  if (!alloc && cptr) {
3816  return SWIG_RuntimeError;
3817  }
3818  obj = PyUnicode_AsUTF8String(obj);
3819  if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3820  if (cptr) {
3821  if (alloc) *alloc = SWIG_NEWOBJ;
3822  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3823  }
3824  if (psize) *psize = len + 1;
3825 
3826  Py_XDECREF(obj);
3827  return SWIG_OK;
3828  } else {
3829  Py_XDECREF(obj);
3830  }
3831  }
3832 #endif
3833 #endif
3834 
3835  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3836  if (pchar_descriptor) {
3837  void* vptr = 0;
3838  if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3839  if (cptr) *cptr = (char *) vptr;
3840  if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3841  if (alloc) *alloc = SWIG_OLDOBJ;
3842  return SWIG_OK;
3843  }
3844  }
3845  }
3846  return SWIG_TypeError;
3847 }
3848 
3849 
3850 SWIGINTERN int
3851 SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
3852 {
3853  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
3854  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
3855  if (SWIG_IsOK(res)) {
3856  /* special case of single char conversion when we don't need space for NUL */
3857  if (size == 1 && csize == 2 && cptr && !cptr[1]) --csize;
3858  if (csize <= size) {
3859  if (val) {
3860  if (csize) memcpy(val, cptr, csize*sizeof(char));
3861  if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
3862  }
3863  if (alloc == SWIG_NEWOBJ) {
3864  delete[] cptr;
3865  res = SWIG_DelNewMask(res);
3866  }
3867  return res;
3868  }
3869  if (alloc == SWIG_NEWOBJ) delete[] cptr;
3870  }
3871  return SWIG_TypeError;
3872 }
3873 
3874 
3875 SWIGINTERN int
3876 SWIG_AsVal_long (PyObject *obj, long* val)
3877 {
3878 #if PY_VERSION_HEX < 0x03000000
3879  if (PyInt_Check(obj)) {
3880  if (val) *val = PyInt_AsLong(obj);
3881  return SWIG_OK;
3882  } else
3883 #endif
3884  if (PyLong_Check(obj)) {
3885  long v = PyLong_AsLong(obj);
3886  if (!PyErr_Occurred()) {
3887  if (val) *val = v;
3888  return SWIG_OK;
3889  } else {
3890  PyErr_Clear();
3891  return SWIG_OverflowError;
3892  }
3893  }
3894 #ifdef SWIG_PYTHON_CAST_MODE
3895  {
3896  int dispatch = 0;
3897  long v = PyInt_AsLong(obj);
3898  if (!PyErr_Occurred()) {
3899  if (val) *val = v;
3900  return SWIG_AddCast(SWIG_OK);
3901  } else {
3902  PyErr_Clear();
3903  }
3904  if (!dispatch) {
3905  double d;
3906  int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3907  if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3908  if (val) *val = (long)(d);
3909  return res;
3910  }
3911  }
3912  }
3913 #endif
3914  return SWIG_TypeError;
3915 }
3916 
3917 
3918 SWIGINTERN int
3919 SWIG_AsVal_char (PyObject * obj, char *val)
3920 {
3921  int res = SWIG_AsCharArray(obj, val, 1);
3922  if (!SWIG_IsOK(res)) {
3923  long v;
3924  res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
3925  if (SWIG_IsOK(res)) {
3926  if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
3927  if (val) *val = static_cast< char >(v);
3928  } else {
3929  res = SWIG_OverflowError;
3930  }
3931  }
3932  }
3933  return res;
3934 }
3935 
3936 
3937 SWIGINTERNINLINE PyObject *
3938 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3939 {
3940  if (carray) {
3941  if (size > INT_MAX) {
3942  swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3943  return pchar_descriptor ?
3944  SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3945  } else {
3946 #if PY_VERSION_HEX >= 0x03000000
3947 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3948  return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3949 #else
3950 #if PY_VERSION_HEX >= 0x03010000
3951  return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
3952 #else
3953  return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3954 #endif
3955 #endif
3956 #else
3957  return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
3958 #endif
3959  }
3960  } else {
3961  return SWIG_Py_Void();
3962  }
3963 }
3964 
3965 
3966 SWIGINTERNINLINE PyObject *
3967 SWIG_FromCharPtr(const char *cptr)
3968 {
3969  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
3970 }
3971 
3972 
3973 SWIGINTERNINLINE PyObject *
3974 SWIG_From_char (char c)
3975 {
3976  return SWIG_FromCharPtrAndSize(&c,1);
3977 }
3978 
3979 
3980 SWIGINTERN int
3981 SWIG_AsVal_int (PyObject * obj, int *val)
3982 {
3983  long v;
3984  int res = SWIG_AsVal_long (obj, &v);
3985  if (SWIG_IsOK(res)) {
3986  if ((v < INT_MIN || v > INT_MAX)) {
3987  return SWIG_OverflowError;
3988  } else {
3989  if (val) *val = static_cast< int >(v);
3990  }
3991  }
3992  return res;
3993 }
3994 
3995 
3996 SWIGINTERNINLINE PyObject*
3997  SWIG_From_int (int value)
3998 {
3999  return PyInt_FromLong((long) value);
4000 }
4001 
4002 
4003 #include <string>
4004 
4005 
4006 int get_num_gpus()
4007 {
4008  return 0;
4009 }
4010 
4011 
4012 SWIGINTERN int
4013 SWIG_AsVal_bool (PyObject *obj, bool *val)
4014 {
4015  int r;
4016  if (!PyBool_Check(obj))
4017  return SWIG_ERROR;
4018  r = PyObject_IsTrue(obj);
4019  if (r == -1)
4020  return SWIG_ERROR;
4021  if (val) *val = r ? true : false;
4022  return SWIG_OK;
4023 }
4024 
4025 
4026 SWIGINTERNINLINE PyObject*
4027  SWIG_From_bool (bool value)
4028 {
4029  return PyBool_FromLong(value ? 1 : 0);
4030 }
4031 
4032 
4033 SWIGINTERN int
4034 SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
4035 {
4036  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
4037  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
4038  if (buf) {
4039  if (val) *val = new std::string(buf, size - 1);
4040  if (alloc == SWIG_NEWOBJ) delete[] buf;
4041  return SWIG_NEWOBJ;
4042  } else {
4043  if (val) *val = 0;
4044  return SWIG_OLDOBJ;
4045  }
4046  } else {
4047  static int init = 0;
4048  static swig_type_info* descriptor = 0;
4049  if (!init) {
4050  descriptor = SWIG_TypeQuery("std::string" " *");
4051  init = 1;
4052  }
4053  if (descriptor) {
4054  std::string *vptr;
4055  int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
4056  if (SWIG_IsOK(res) && val) *val = vptr;
4057  return res;
4058  }
4059  }
4060  return SWIG_ERROR;
4061 }
4062 
4063 
4064 SWIGINTERNINLINE PyObject *
4065 SWIG_From_std_string (const std::string& s)
4066 {
4067  return SWIG_FromCharPtrAndSize(s.data(), s.size());
4068 }
4069 
4070 
4071 
4072 
4073 
4074 faiss::Index * downcast_index (faiss::Index *index)
4075 {
4076  return index;
4077 }
4078 faiss::VectorTransform * downcast_VectorTransform (faiss::VectorTransform *vt)
4079 {
4080  return vt;
4081 }
4082 faiss::IndexBinary * downcast_IndexBinary (faiss::IndexBinary *index)
4083 {
4084  return index;
4085 }
4086 
4087 
4088 PyObject *swig_ptr (PyObject *a)
4089 {
4090  if(!PyArray_Check(a)) {
4091  PyErr_SetString(PyExc_ValueError, "input not a numpy array");
4092  return NULL;
4093  }
4094  PyArrayObject *ao = (PyArrayObject *)a;
4095 
4096  if(!PyArray_ISCONTIGUOUS(ao)) {
4097  PyErr_SetString(PyExc_ValueError, "array is not C-contiguous");
4098  return NULL;
4099  }
4100  void * data = PyArray_DATA(ao);
4101  if(PyArray_TYPE(ao) == NPY_FLOAT32) {
4102  return SWIG_NewPointerObj(data, SWIGTYPE_p_float, 0);
4103  }
4104  if(PyArray_TYPE(ao) == NPY_FLOAT64) {
4105  return SWIG_NewPointerObj(data, SWIGTYPE_p_double, 0);
4106  }
4107  if(PyArray_TYPE(ao) == NPY_INT32) {
4108  return SWIG_NewPointerObj(data, SWIGTYPE_p_int, 0);
4109  }
4110  if(PyArray_TYPE(ao) == NPY_UINT8) {
4111  return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_char, 0);
4112  }
4113  if(PyArray_TYPE(ao) == NPY_INT8) {
4114  return SWIG_NewPointerObj(data, SWIGTYPE_p_char, 0);
4115  }
4116  if(PyArray_TYPE(ao) == NPY_UINT64) {
4117  return SWIG_NewPointerObj(data, SWIGTYPE_p_unsigned_long, 0);
4118  }
4119  if(PyArray_TYPE(ao) == NPY_INT64) {
4120  return SWIG_NewPointerObj(data, SWIGTYPE_p_long, 0);
4121  }
4122  PyErr_SetString(PyExc_ValueError, "did not recognize array type");
4123  return NULL;
4124 }
4125 
4126 
4128 
4129  bool want_interrupt () override {
4130  int err;
4131  {
4132  PyGILState_STATE gstate;
4133  gstate = PyGILState_Ensure();
4134  err = PyErr_CheckSignals();
4135  PyGILState_Release(gstate);
4136  }
4137  return err == -1;
4138  }
4139 
4140 };
4141 
4142 
4143 
4144 
4145 PyObject * rev_swig_ptr(float *src, npy_intp size) {
4146  return PyArray_SimpleNewFromData(1, &size, NPY_FLOAT32, src);
4147 }
4148 
4149 
4150 PyObject * rev_swig_ptr(int *src, npy_intp size) {
4151  return PyArray_SimpleNewFromData(1, &size, NPY_INT32, src);
4152 }
4153 
4154 
4155 PyObject * rev_swig_ptr(unsigned char *src, npy_intp size) {
4156  return PyArray_SimpleNewFromData(1, &size, NPY_UINT8, src);
4157 }
4158 
4159 
4160 PyObject * rev_swig_ptr(unsigned long *src, npy_intp size) {
4161  return PyArray_SimpleNewFromData(1, &size, NPY_UINT64, src);
4162 }
4163 
4164 
4165 PyObject * rev_swig_ptr(long *src, npy_intp size) {
4166  return PyArray_SimpleNewFromData(1, &size, NPY_INT64, src);
4167 }
4168 
4169 
4170 float * cast_integer_to_float_ptr (long x) {
4171  return (float*)x;
4172 }
4173 
4174 long * cast_integer_to_long_ptr (long x) {
4175  return (long*)x;
4176 }
4177 
4178 int * cast_integer_to_int_ptr (long x) {
4179  return (int*)x;
4180 }
4181 
4182 
4183 
4184 // may be useful for lua code launched in background from shell
4185 
4186 #include <signal.h>
4187 void ignore_SIGTTIN() {
4188  signal(SIGTTIN, SIG_IGN);
4189 }
4190 
4191 
4192 
4193 // numpy misses a hash table implementation, hence this class. It
4194 // represents not found values as -1 like in the Index implementation
4195 
4197  std::unordered_map<long, long> map;
4198 
4199  void add(size_t n, const long *keys, const long *vals) {
4200  map.reserve(map.size() + n);
4201  for (size_t i = 0; i < n; i++) {
4202  map[keys[i]] = vals[i];
4203  }
4204  }
4205 
4206  long search(long key) {
4207  if (map.count(key) == 0) {
4208  return -1;
4209  } else {
4210  return map[key];
4211  }
4212  }
4213 
4214  void search_multiple(size_t n, const long *keys, long * vals) {
4215  for (size_t i = 0; i < n; i++) {
4216  vals[i] = search(keys[i]);
4217  }
4218  }
4219 };
4220 
4221 
4222 #ifdef __cplusplus
4223 extern "C" {
4224 #endif
4225 SWIGINTERN PyObject *_wrap_new_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4226  PyObject *resultobj = 0;
4227  std::vector< float > *result = 0 ;
4228 
4229  if (!PyArg_ParseTuple(args,(char *)":new_FloatVector")) SWIG_fail;
4230  result = (std::vector< float > *)new std::vector< float >();
4231  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_NEW | 0 );
4232  return resultobj;
4233 fail:
4234  return NULL;
4235 }
4236 
4237 
4238 SWIGINTERN PyObject *_wrap_FloatVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4239  PyObject *resultobj = 0;
4240  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4241  float arg2 ;
4242  void *argp1 = 0 ;
4243  int res1 = 0 ;
4244  float val2 ;
4245  int ecode2 = 0 ;
4246  PyObject * obj0 = 0 ;
4247  PyObject * obj1 = 0 ;
4248 
4249  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_push_back",&obj0,&obj1)) SWIG_fail;
4250  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4251  if (!SWIG_IsOK(res1)) {
4252  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_push_back" "', argument " "1"" of type '" "std::vector< float > *""'");
4253  }
4254  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4255  ecode2 = SWIG_AsVal_float(obj1, &val2);
4256  if (!SWIG_IsOK(ecode2)) {
4257  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_push_back" "', argument " "2"" of type '" "float""'");
4258  }
4259  arg2 = static_cast< float >(val2);
4260  (arg1)->push_back(arg2);
4261  resultobj = SWIG_Py_Void();
4262  return resultobj;
4263 fail:
4264  return NULL;
4265 }
4266 
4267 
4268 SWIGINTERN PyObject *_wrap_FloatVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4269  PyObject *resultobj = 0;
4270  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4271  void *argp1 = 0 ;
4272  int res1 = 0 ;
4273  PyObject * obj0 = 0 ;
4274 
4275  if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_clear",&obj0)) SWIG_fail;
4276  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4277  if (!SWIG_IsOK(res1)) {
4278  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_clear" "', argument " "1"" of type '" "std::vector< float > *""'");
4279  }
4280  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4281  (arg1)->clear();
4282  resultobj = SWIG_Py_Void();
4283  return resultobj;
4284 fail:
4285  return NULL;
4286 }
4287 
4288 
4289 SWIGINTERN PyObject *_wrap_FloatVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4290  PyObject *resultobj = 0;
4291  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4292  void *argp1 = 0 ;
4293  int res1 = 0 ;
4294  PyObject * obj0 = 0 ;
4295  float *result = 0 ;
4296 
4297  if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_data",&obj0)) SWIG_fail;
4298  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4299  if (!SWIG_IsOK(res1)) {
4300  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_data" "', argument " "1"" of type '" "std::vector< float > *""'");
4301  }
4302  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4303  result = (float *)(arg1)->data();
4304  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
4305  return resultobj;
4306 fail:
4307  return NULL;
4308 }
4309 
4310 
4311 SWIGINTERN PyObject *_wrap_FloatVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4312  PyObject *resultobj = 0;
4313  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4314  void *argp1 = 0 ;
4315  int res1 = 0 ;
4316  PyObject * obj0 = 0 ;
4317  size_t result;
4318 
4319  if (!PyArg_ParseTuple(args,(char *)"O:FloatVector_size",&obj0)) SWIG_fail;
4320  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4321  if (!SWIG_IsOK(res1)) {
4322  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_size" "', argument " "1"" of type '" "std::vector< float > *""'");
4323  }
4324  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4325  result = (size_t)(arg1)->size();
4326  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
4327  return resultobj;
4328 fail:
4329  return NULL;
4330 }
4331 
4332 
4333 SWIGINTERN PyObject *_wrap_FloatVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4334  PyObject *resultobj = 0;
4335  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4336  size_t arg2 ;
4337  void *argp1 = 0 ;
4338  int res1 = 0 ;
4339  size_t val2 ;
4340  int ecode2 = 0 ;
4341  PyObject * obj0 = 0 ;
4342  PyObject * obj1 = 0 ;
4343  float result;
4344 
4345  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_at",&obj0,&obj1)) SWIG_fail;
4346  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4347  if (!SWIG_IsOK(res1)) {
4348  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_at" "', argument " "1"" of type '" "std::vector< float > const *""'");
4349  }
4350  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4351  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4352  if (!SWIG_IsOK(ecode2)) {
4353  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_at" "', argument " "2"" of type '" "size_t""'");
4354  }
4355  arg2 = static_cast< size_t >(val2);
4356  result = (float)((std::vector< float > const *)arg1)->at(arg2);
4357  resultobj = SWIG_From_float(static_cast< float >(result));
4358  return resultobj;
4359 fail:
4360  return NULL;
4361 }
4362 
4363 
4364 SWIGINTERN PyObject *_wrap_FloatVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4365  PyObject *resultobj = 0;
4366  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4367  size_t arg2 ;
4368  void *argp1 = 0 ;
4369  int res1 = 0 ;
4370  size_t val2 ;
4371  int ecode2 = 0 ;
4372  PyObject * obj0 = 0 ;
4373  PyObject * obj1 = 0 ;
4374 
4375  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_resize",&obj0,&obj1)) SWIG_fail;
4376  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4377  if (!SWIG_IsOK(res1)) {
4378  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_resize" "', argument " "1"" of type '" "std::vector< float > *""'");
4379  }
4380  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4381  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4382  if (!SWIG_IsOK(ecode2)) {
4383  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVector_resize" "', argument " "2"" of type '" "size_t""'");
4384  }
4385  arg2 = static_cast< size_t >(val2);
4386  (arg1)->resize(arg2);
4387  resultobj = SWIG_Py_Void();
4388  return resultobj;
4389 fail:
4390  return NULL;
4391 }
4392 
4393 
4394 SWIGINTERN PyObject *_wrap_FloatVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4395  PyObject *resultobj = 0;
4396  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4397  std::vector< float > *arg2 = 0 ;
4398  void *argp1 = 0 ;
4399  int res1 = 0 ;
4400  void *argp2 = 0 ;
4401  int res2 = 0 ;
4402  PyObject * obj0 = 0 ;
4403  PyObject * obj1 = 0 ;
4404 
4405  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVector_swap",&obj0,&obj1)) SWIG_fail;
4406  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
4407  if (!SWIG_IsOK(res1)) {
4408  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVector_swap" "', argument " "1"" of type '" "std::vector< float > *""'");
4409  }
4410  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4411  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 );
4412  if (!SWIG_IsOK(res2)) {
4413  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'");
4414  }
4415  if (!argp2) {
4416  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVector_swap" "', argument " "2"" of type '" "std::vector< float > &""'");
4417  }
4418  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
4419  (arg1)->swap(*arg2);
4420  resultobj = SWIG_Py_Void();
4421  return resultobj;
4422 fail:
4423  return NULL;
4424 }
4425 
4426 
4427 SWIGINTERN PyObject *_wrap_delete_FloatVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4428  PyObject *resultobj = 0;
4429  std::vector< float > *arg1 = (std::vector< float > *) 0 ;
4430  void *argp1 = 0 ;
4431  int res1 = 0 ;
4432  PyObject * obj0 = 0 ;
4433 
4434  if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVector",&obj0)) SWIG_fail;
4435  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_DISOWN | 0 );
4436  if (!SWIG_IsOK(res1)) {
4437  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVector" "', argument " "1"" of type '" "std::vector< float > *""'");
4438  }
4439  arg1 = reinterpret_cast< std::vector< float > * >(argp1);
4440  delete arg1;
4441  resultobj = SWIG_Py_Void();
4442  return resultobj;
4443 fail:
4444  return NULL;
4445 }
4446 
4447 
4448 SWIGINTERN PyObject *FloatVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4449  PyObject *obj;
4450  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
4451  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_float_t, SWIG_NewClientData(obj));
4452  return SWIG_Py_Void();
4453 }
4454 
4455 SWIGINTERN PyObject *_wrap_new_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4456  PyObject *resultobj = 0;
4457  std::vector< double > *result = 0 ;
4458 
4459  if (!PyArg_ParseTuple(args,(char *)":new_DoubleVector")) SWIG_fail;
4460  result = (std::vector< double > *)new std::vector< double >();
4461  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_NEW | 0 );
4462  return resultobj;
4463 fail:
4464  return NULL;
4465 }
4466 
4467 
4468 SWIGINTERN PyObject *_wrap_DoubleVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4469  PyObject *resultobj = 0;
4470  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4471  double arg2 ;
4472  void *argp1 = 0 ;
4473  int res1 = 0 ;
4474  double val2 ;
4475  int ecode2 = 0 ;
4476  PyObject * obj0 = 0 ;
4477  PyObject * obj1 = 0 ;
4478 
4479  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_push_back",&obj0,&obj1)) SWIG_fail;
4480  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4481  if (!SWIG_IsOK(res1)) {
4482  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_push_back" "', argument " "1"" of type '" "std::vector< double > *""'");
4483  }
4484  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4485  ecode2 = SWIG_AsVal_double(obj1, &val2);
4486  if (!SWIG_IsOK(ecode2)) {
4487  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_push_back" "', argument " "2"" of type '" "double""'");
4488  }
4489  arg2 = static_cast< double >(val2);
4490  (arg1)->push_back(arg2);
4491  resultobj = SWIG_Py_Void();
4492  return resultobj;
4493 fail:
4494  return NULL;
4495 }
4496 
4497 
4498 SWIGINTERN PyObject *_wrap_DoubleVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4499  PyObject *resultobj = 0;
4500  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4501  void *argp1 = 0 ;
4502  int res1 = 0 ;
4503  PyObject * obj0 = 0 ;
4504 
4505  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_clear",&obj0)) SWIG_fail;
4506  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4507  if (!SWIG_IsOK(res1)) {
4508  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_clear" "', argument " "1"" of type '" "std::vector< double > *""'");
4509  }
4510  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4511  (arg1)->clear();
4512  resultobj = SWIG_Py_Void();
4513  return resultobj;
4514 fail:
4515  return NULL;
4516 }
4517 
4518 
4519 SWIGINTERN PyObject *_wrap_DoubleVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4520  PyObject *resultobj = 0;
4521  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4522  void *argp1 = 0 ;
4523  int res1 = 0 ;
4524  PyObject * obj0 = 0 ;
4525  double *result = 0 ;
4526 
4527  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_data",&obj0)) SWIG_fail;
4528  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4529  if (!SWIG_IsOK(res1)) {
4530  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_data" "', argument " "1"" of type '" "std::vector< double > *""'");
4531  }
4532  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4533  result = (double *)(arg1)->data();
4534  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 );
4535  return resultobj;
4536 fail:
4537  return NULL;
4538 }
4539 
4540 
4541 SWIGINTERN PyObject *_wrap_DoubleVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4542  PyObject *resultobj = 0;
4543  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4544  void *argp1 = 0 ;
4545  int res1 = 0 ;
4546  PyObject * obj0 = 0 ;
4547  size_t result;
4548 
4549  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_size",&obj0)) SWIG_fail;
4550  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4551  if (!SWIG_IsOK(res1)) {
4552  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_size" "', argument " "1"" of type '" "std::vector< double > *""'");
4553  }
4554  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4555  result = (size_t)(arg1)->size();
4556  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
4557  return resultobj;
4558 fail:
4559  return NULL;
4560 }
4561 
4562 
4563 SWIGINTERN PyObject *_wrap_DoubleVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4564  PyObject *resultobj = 0;
4565  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4566  size_t arg2 ;
4567  void *argp1 = 0 ;
4568  int res1 = 0 ;
4569  size_t val2 ;
4570  int ecode2 = 0 ;
4571  PyObject * obj0 = 0 ;
4572  PyObject * obj1 = 0 ;
4573  double result;
4574 
4575  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_at",&obj0,&obj1)) SWIG_fail;
4576  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4577  if (!SWIG_IsOK(res1)) {
4578  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_at" "', argument " "1"" of type '" "std::vector< double > const *""'");
4579  }
4580  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4581  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4582  if (!SWIG_IsOK(ecode2)) {
4583  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_at" "', argument " "2"" of type '" "size_t""'");
4584  }
4585  arg2 = static_cast< size_t >(val2);
4586  result = (double)((std::vector< double > const *)arg1)->at(arg2);
4587  resultobj = SWIG_From_double(static_cast< double >(result));
4588  return resultobj;
4589 fail:
4590  return NULL;
4591 }
4592 
4593 
4594 SWIGINTERN PyObject *_wrap_DoubleVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4595  PyObject *resultobj = 0;
4596  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4597  size_t arg2 ;
4598  void *argp1 = 0 ;
4599  int res1 = 0 ;
4600  size_t val2 ;
4601  int ecode2 = 0 ;
4602  PyObject * obj0 = 0 ;
4603  PyObject * obj1 = 0 ;
4604 
4605  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_resize",&obj0,&obj1)) SWIG_fail;
4606  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4607  if (!SWIG_IsOK(res1)) {
4608  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_resize" "', argument " "1"" of type '" "std::vector< double > *""'");
4609  }
4610  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4611  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4612  if (!SWIG_IsOK(ecode2)) {
4613  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_resize" "', argument " "2"" of type '" "size_t""'");
4614  }
4615  arg2 = static_cast< size_t >(val2);
4616  (arg1)->resize(arg2);
4617  resultobj = SWIG_Py_Void();
4618  return resultobj;
4619 fail:
4620  return NULL;
4621 }
4622 
4623 
4624 SWIGINTERN PyObject *_wrap_DoubleVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4625  PyObject *resultobj = 0;
4626  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4627  std::vector< double > *arg2 = 0 ;
4628  void *argp1 = 0 ;
4629  int res1 = 0 ;
4630  void *argp2 = 0 ;
4631  int res2 = 0 ;
4632  PyObject * obj0 = 0 ;
4633  PyObject * obj1 = 0 ;
4634 
4635  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_swap",&obj0,&obj1)) SWIG_fail;
4636  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, 0 | 0 );
4637  if (!SWIG_IsOK(res1)) {
4638  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_swap" "', argument " "1"" of type '" "std::vector< double > *""'");
4639  }
4640  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4641  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_t, 0 );
4642  if (!SWIG_IsOK(res2)) {
4643  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'");
4644  }
4645  if (!argp2) {
4646  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'");
4647  }
4648  arg2 = reinterpret_cast< std::vector< double > * >(argp2);
4649  (arg1)->swap(*arg2);
4650  resultobj = SWIG_Py_Void();
4651  return resultobj;
4652 fail:
4653  return NULL;
4654 }
4655 
4656 
4657 SWIGINTERN PyObject *_wrap_delete_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4658  PyObject *resultobj = 0;
4659  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
4660  void *argp1 = 0 ;
4661  int res1 = 0 ;
4662  PyObject * obj0 = 0 ;
4663 
4664  if (!PyArg_ParseTuple(args,(char *)"O:delete_DoubleVector",&obj0)) SWIG_fail;
4665  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_t, SWIG_POINTER_DISOWN | 0 );
4666  if (!SWIG_IsOK(res1)) {
4667  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DoubleVector" "', argument " "1"" of type '" "std::vector< double > *""'");
4668  }
4669  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
4670  delete arg1;
4671  resultobj = SWIG_Py_Void();
4672  return resultobj;
4673 fail:
4674  return NULL;
4675 }
4676 
4677 
4678 SWIGINTERN PyObject *DoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4679  PyObject *obj;
4680  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
4681  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_t, SWIG_NewClientData(obj));
4682  return SWIG_Py_Void();
4683 }
4684 
4685 SWIGINTERN PyObject *_wrap_new_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4686  PyObject *resultobj = 0;
4687  std::vector< uint8_t > *result = 0 ;
4688 
4689  if (!PyArg_ParseTuple(args,(char *)":new_ByteVector")) SWIG_fail;
4690  result = (std::vector< uint8_t > *)new std::vector< uint8_t >();
4691  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_NEW | 0 );
4692  return resultobj;
4693 fail:
4694  return NULL;
4695 }
4696 
4697 
4698 SWIGINTERN PyObject *_wrap_ByteVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4699  PyObject *resultobj = 0;
4700  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4701  unsigned char arg2 ;
4702  void *argp1 = 0 ;
4703  int res1 = 0 ;
4704  unsigned char val2 ;
4705  int ecode2 = 0 ;
4706  PyObject * obj0 = 0 ;
4707  PyObject * obj1 = 0 ;
4708 
4709  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_push_back",&obj0,&obj1)) SWIG_fail;
4710  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4711  if (!SWIG_IsOK(res1)) {
4712  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_push_back" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4713  }
4714  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4715  ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
4716  if (!SWIG_IsOK(ecode2)) {
4717  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_push_back" "', argument " "2"" of type '" "unsigned char""'");
4718  }
4719  arg2 = static_cast< unsigned char >(val2);
4720  (arg1)->push_back(arg2);
4721  resultobj = SWIG_Py_Void();
4722  return resultobj;
4723 fail:
4724  return NULL;
4725 }
4726 
4727 
4728 SWIGINTERN PyObject *_wrap_ByteVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4729  PyObject *resultobj = 0;
4730  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4731  void *argp1 = 0 ;
4732  int res1 = 0 ;
4733  PyObject * obj0 = 0 ;
4734 
4735  if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_clear",&obj0)) SWIG_fail;
4736  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4737  if (!SWIG_IsOK(res1)) {
4738  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_clear" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4739  }
4740  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4741  (arg1)->clear();
4742  resultobj = SWIG_Py_Void();
4743  return resultobj;
4744 fail:
4745  return NULL;
4746 }
4747 
4748 
4749 SWIGINTERN PyObject *_wrap_ByteVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4750  PyObject *resultobj = 0;
4751  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4752  void *argp1 = 0 ;
4753  int res1 = 0 ;
4754  PyObject * obj0 = 0 ;
4755  unsigned char *result = 0 ;
4756 
4757  if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_data",&obj0)) SWIG_fail;
4758  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4759  if (!SWIG_IsOK(res1)) {
4760  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_data" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4761  }
4762  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4763  result = (unsigned char *)(arg1)->data();
4764  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 );
4765  return resultobj;
4766 fail:
4767  return NULL;
4768 }
4769 
4770 
4771 SWIGINTERN PyObject *_wrap_ByteVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4772  PyObject *resultobj = 0;
4773  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4774  void *argp1 = 0 ;
4775  int res1 = 0 ;
4776  PyObject * obj0 = 0 ;
4777  size_t result;
4778 
4779  if (!PyArg_ParseTuple(args,(char *)"O:ByteVector_size",&obj0)) SWIG_fail;
4780  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4781  if (!SWIG_IsOK(res1)) {
4782  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_size" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4783  }
4784  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4785  result = (size_t)(arg1)->size();
4786  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
4787  return resultobj;
4788 fail:
4789  return NULL;
4790 }
4791 
4792 
4793 SWIGINTERN PyObject *_wrap_ByteVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4794  PyObject *resultobj = 0;
4795  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4796  size_t arg2 ;
4797  void *argp1 = 0 ;
4798  int res1 = 0 ;
4799  size_t val2 ;
4800  int ecode2 = 0 ;
4801  PyObject * obj0 = 0 ;
4802  PyObject * obj1 = 0 ;
4803  unsigned char result;
4804 
4805  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_at",&obj0,&obj1)) SWIG_fail;
4806  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4807  if (!SWIG_IsOK(res1)) {
4808  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_at" "', argument " "1"" of type '" "std::vector< uint8_t > const *""'");
4809  }
4810  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4811  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4812  if (!SWIG_IsOK(ecode2)) {
4813  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_at" "', argument " "2"" of type '" "size_t""'");
4814  }
4815  arg2 = static_cast< size_t >(val2);
4816  result = (unsigned char)((std::vector< uint8_t > const *)arg1)->at(arg2);
4817  resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result));
4818  return resultobj;
4819 fail:
4820  return NULL;
4821 }
4822 
4823 
4824 SWIGINTERN PyObject *_wrap_ByteVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4825  PyObject *resultobj = 0;
4826  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4827  size_t arg2 ;
4828  void *argp1 = 0 ;
4829  int res1 = 0 ;
4830  size_t val2 ;
4831  int ecode2 = 0 ;
4832  PyObject * obj0 = 0 ;
4833  PyObject * obj1 = 0 ;
4834 
4835  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_resize",&obj0,&obj1)) SWIG_fail;
4836  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4837  if (!SWIG_IsOK(res1)) {
4838  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_resize" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4839  }
4840  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4841  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4842  if (!SWIG_IsOK(ecode2)) {
4843  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVector_resize" "', argument " "2"" of type '" "size_t""'");
4844  }
4845  arg2 = static_cast< size_t >(val2);
4846  (arg1)->resize(arg2);
4847  resultobj = SWIG_Py_Void();
4848  return resultobj;
4849 fail:
4850  return NULL;
4851 }
4852 
4853 
4854 SWIGINTERN PyObject *_wrap_ByteVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4855  PyObject *resultobj = 0;
4856  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4857  std::vector< unsigned char > *arg2 = 0 ;
4858  void *argp1 = 0 ;
4859  int res1 = 0 ;
4860  void *argp2 = 0 ;
4861  int res2 = 0 ;
4862  PyObject * obj0 = 0 ;
4863  PyObject * obj1 = 0 ;
4864 
4865  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVector_swap",&obj0,&obj1)) SWIG_fail;
4866  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
4867  if (!SWIG_IsOK(res1)) {
4868  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVector_swap" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4869  }
4870  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4871  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 );
4872  if (!SWIG_IsOK(res2)) {
4873  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'");
4874  }
4875  if (!argp2) {
4876  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVector_swap" "', argument " "2"" of type '" "std::vector< unsigned char > &""'");
4877  }
4878  arg2 = reinterpret_cast< std::vector< unsigned char > * >(argp2);
4879  (arg1)->swap(*arg2);
4880  resultobj = SWIG_Py_Void();
4881  return resultobj;
4882 fail:
4883  return NULL;
4884 }
4885 
4886 
4887 SWIGINTERN PyObject *_wrap_delete_ByteVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4888  PyObject *resultobj = 0;
4889  std::vector< uint8_t > *arg1 = (std::vector< uint8_t > *) 0 ;
4890  void *argp1 = 0 ;
4891  int res1 = 0 ;
4892  PyObject * obj0 = 0 ;
4893 
4894  if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVector",&obj0)) SWIG_fail;
4895  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_DISOWN | 0 );
4896  if (!SWIG_IsOK(res1)) {
4897  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVector" "', argument " "1"" of type '" "std::vector< uint8_t > *""'");
4898  }
4899  arg1 = reinterpret_cast< std::vector< uint8_t > * >(argp1);
4900  delete arg1;
4901  resultobj = SWIG_Py_Void();
4902  return resultobj;
4903 fail:
4904  return NULL;
4905 }
4906 
4907 
4908 SWIGINTERN PyObject *ByteVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4909  PyObject *obj;
4910  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
4911  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_NewClientData(obj));
4912  return SWIG_Py_Void();
4913 }
4914 
4915 SWIGINTERN PyObject *_wrap_new_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4916  PyObject *resultobj = 0;
4917  std::vector< char > *result = 0 ;
4918 
4919  if (!PyArg_ParseTuple(args,(char *)":new_CharVector")) SWIG_fail;
4920  result = (std::vector< char > *)new std::vector< char >();
4921  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_NEW | 0 );
4922  return resultobj;
4923 fail:
4924  return NULL;
4925 }
4926 
4927 
4928 SWIGINTERN PyObject *_wrap_CharVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4929  PyObject *resultobj = 0;
4930  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
4931  char arg2 ;
4932  void *argp1 = 0 ;
4933  int res1 = 0 ;
4934  char val2 ;
4935  int ecode2 = 0 ;
4936  PyObject * obj0 = 0 ;
4937  PyObject * obj1 = 0 ;
4938 
4939  if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_push_back",&obj0,&obj1)) SWIG_fail;
4940  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
4941  if (!SWIG_IsOK(res1)) {
4942  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_push_back" "', argument " "1"" of type '" "std::vector< char > *""'");
4943  }
4944  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
4945  ecode2 = SWIG_AsVal_char(obj1, &val2);
4946  if (!SWIG_IsOK(ecode2)) {
4947  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_push_back" "', argument " "2"" of type '" "char""'");
4948  }
4949  arg2 = static_cast< char >(val2);
4950  (arg1)->push_back(arg2);
4951  resultobj = SWIG_Py_Void();
4952  return resultobj;
4953 fail:
4954  return NULL;
4955 }
4956 
4957 
4958 SWIGINTERN PyObject *_wrap_CharVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4959  PyObject *resultobj = 0;
4960  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
4961  void *argp1 = 0 ;
4962  int res1 = 0 ;
4963  PyObject * obj0 = 0 ;
4964 
4965  if (!PyArg_ParseTuple(args,(char *)"O:CharVector_clear",&obj0)) SWIG_fail;
4966  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
4967  if (!SWIG_IsOK(res1)) {
4968  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_clear" "', argument " "1"" of type '" "std::vector< char > *""'");
4969  }
4970  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
4971  (arg1)->clear();
4972  resultobj = SWIG_Py_Void();
4973  return resultobj;
4974 fail:
4975  return NULL;
4976 }
4977 
4978 
4979 SWIGINTERN PyObject *_wrap_CharVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4980  PyObject *resultobj = 0;
4981  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
4982  void *argp1 = 0 ;
4983  int res1 = 0 ;
4984  PyObject * obj0 = 0 ;
4985  char *result = 0 ;
4986 
4987  if (!PyArg_ParseTuple(args,(char *)"O:CharVector_data",&obj0)) SWIG_fail;
4988  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
4989  if (!SWIG_IsOK(res1)) {
4990  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_data" "', argument " "1"" of type '" "std::vector< char > *""'");
4991  }
4992  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
4993  result = (char *)(arg1)->data();
4994  resultobj = SWIG_FromCharPtr((const char *)result);
4995  return resultobj;
4996 fail:
4997  return NULL;
4998 }
4999 
5000 
5001 SWIGINTERN PyObject *_wrap_CharVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5002  PyObject *resultobj = 0;
5003  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
5004  void *argp1 = 0 ;
5005  int res1 = 0 ;
5006  PyObject * obj0 = 0 ;
5007  size_t result;
5008 
5009  if (!PyArg_ParseTuple(args,(char *)"O:CharVector_size",&obj0)) SWIG_fail;
5010  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
5011  if (!SWIG_IsOK(res1)) {
5012  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_size" "', argument " "1"" of type '" "std::vector< char > *""'");
5013  }
5014  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
5015  result = (size_t)(arg1)->size();
5016  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5017  return resultobj;
5018 fail:
5019  return NULL;
5020 }
5021 
5022 
5023 SWIGINTERN PyObject *_wrap_CharVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5024  PyObject *resultobj = 0;
5025  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
5026  size_t arg2 ;
5027  void *argp1 = 0 ;
5028  int res1 = 0 ;
5029  size_t val2 ;
5030  int ecode2 = 0 ;
5031  PyObject * obj0 = 0 ;
5032  PyObject * obj1 = 0 ;
5033  char result;
5034 
5035  if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_at",&obj0,&obj1)) SWIG_fail;
5036  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
5037  if (!SWIG_IsOK(res1)) {
5038  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_at" "', argument " "1"" of type '" "std::vector< char > const *""'");
5039  }
5040  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
5041  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5042  if (!SWIG_IsOK(ecode2)) {
5043  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_at" "', argument " "2"" of type '" "size_t""'");
5044  }
5045  arg2 = static_cast< size_t >(val2);
5046  result = (char)((std::vector< char > const *)arg1)->at(arg2);
5047  resultobj = SWIG_From_char(static_cast< char >(result));
5048  return resultobj;
5049 fail:
5050  return NULL;
5051 }
5052 
5053 
5054 SWIGINTERN PyObject *_wrap_CharVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5055  PyObject *resultobj = 0;
5056  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
5057  size_t arg2 ;
5058  void *argp1 = 0 ;
5059  int res1 = 0 ;
5060  size_t val2 ;
5061  int ecode2 = 0 ;
5062  PyObject * obj0 = 0 ;
5063  PyObject * obj1 = 0 ;
5064 
5065  if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_resize",&obj0,&obj1)) SWIG_fail;
5066  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
5067  if (!SWIG_IsOK(res1)) {
5068  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_resize" "', argument " "1"" of type '" "std::vector< char > *""'");
5069  }
5070  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
5071  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5072  if (!SWIG_IsOK(ecode2)) {
5073  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CharVector_resize" "', argument " "2"" of type '" "size_t""'");
5074  }
5075  arg2 = static_cast< size_t >(val2);
5076  (arg1)->resize(arg2);
5077  resultobj = SWIG_Py_Void();
5078  return resultobj;
5079 fail:
5080  return NULL;
5081 }
5082 
5083 
5084 SWIGINTERN PyObject *_wrap_CharVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5085  PyObject *resultobj = 0;
5086  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
5087  std::vector< char > *arg2 = 0 ;
5088  void *argp1 = 0 ;
5089  int res1 = 0 ;
5090  void *argp2 = 0 ;
5091  int res2 = 0 ;
5092  PyObject * obj0 = 0 ;
5093  PyObject * obj1 = 0 ;
5094 
5095  if (!PyArg_ParseTuple(args,(char *)"OO:CharVector_swap",&obj0,&obj1)) SWIG_fail;
5096  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, 0 | 0 );
5097  if (!SWIG_IsOK(res1)) {
5098  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CharVector_swap" "', argument " "1"" of type '" "std::vector< char > *""'");
5099  }
5100  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
5101  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_char_t, 0 );
5102  if (!SWIG_IsOK(res2)) {
5103  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'");
5104  }
5105  if (!argp2) {
5106  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CharVector_swap" "', argument " "2"" of type '" "std::vector< char > &""'");
5107  }
5108  arg2 = reinterpret_cast< std::vector< char > * >(argp2);
5109  (arg1)->swap(*arg2);
5110  resultobj = SWIG_Py_Void();
5111  return resultobj;
5112 fail:
5113  return NULL;
5114 }
5115 
5116 
5117 SWIGINTERN PyObject *_wrap_delete_CharVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5118  PyObject *resultobj = 0;
5119  std::vector< char > *arg1 = (std::vector< char > *) 0 ;
5120  void *argp1 = 0 ;
5121  int res1 = 0 ;
5122  PyObject * obj0 = 0 ;
5123 
5124  if (!PyArg_ParseTuple(args,(char *)"O:delete_CharVector",&obj0)) SWIG_fail;
5125  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_char_t, SWIG_POINTER_DISOWN | 0 );
5126  if (!SWIG_IsOK(res1)) {
5127  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CharVector" "', argument " "1"" of type '" "std::vector< char > *""'");
5128  }
5129  arg1 = reinterpret_cast< std::vector< char > * >(argp1);
5130  delete arg1;
5131  resultobj = SWIG_Py_Void();
5132  return resultobj;
5133 fail:
5134  return NULL;
5135 }
5136 
5137 
5138 SWIGINTERN PyObject *CharVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5139  PyObject *obj;
5140  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
5141  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_char_t, SWIG_NewClientData(obj));
5142  return SWIG_Py_Void();
5143 }
5144 
5145 SWIGINTERN PyObject *_wrap_new_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5146  PyObject *resultobj = 0;
5147  std::vector< unsigned long > *result = 0 ;
5148 
5149  if (!PyArg_ParseTuple(args,(char *)":new_Uint64Vector")) SWIG_fail;
5150  result = (std::vector< unsigned long > *)new std::vector< unsigned long >();
5151  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_NEW | 0 );
5152  return resultobj;
5153 fail:
5154  return NULL;
5155 }
5156 
5157 
5158 SWIGINTERN PyObject *_wrap_Uint64Vector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5159  PyObject *resultobj = 0;
5160  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5161  unsigned long arg2 ;
5162  void *argp1 = 0 ;
5163  int res1 = 0 ;
5164  unsigned long val2 ;
5165  int ecode2 = 0 ;
5166  PyObject * obj0 = 0 ;
5167  PyObject * obj1 = 0 ;
5168 
5169  if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_push_back",&obj0,&obj1)) SWIG_fail;
5170  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5171  if (!SWIG_IsOK(res1)) {
5172  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_push_back" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5173  }
5174  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5175  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
5176  if (!SWIG_IsOK(ecode2)) {
5177  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_push_back" "', argument " "2"" of type '" "unsigned long""'");
5178  }
5179  arg2 = static_cast< unsigned long >(val2);
5180  (arg1)->push_back(arg2);
5181  resultobj = SWIG_Py_Void();
5182  return resultobj;
5183 fail:
5184  return NULL;
5185 }
5186 
5187 
5188 SWIGINTERN PyObject *_wrap_Uint64Vector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5189  PyObject *resultobj = 0;
5190  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5191  void *argp1 = 0 ;
5192  int res1 = 0 ;
5193  PyObject * obj0 = 0 ;
5194 
5195  if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_clear",&obj0)) SWIG_fail;
5196  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5197  if (!SWIG_IsOK(res1)) {
5198  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_clear" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5199  }
5200  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5201  (arg1)->clear();
5202  resultobj = SWIG_Py_Void();
5203  return resultobj;
5204 fail:
5205  return NULL;
5206 }
5207 
5208 
5209 SWIGINTERN PyObject *_wrap_Uint64Vector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5210  PyObject *resultobj = 0;
5211  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5212  void *argp1 = 0 ;
5213  int res1 = 0 ;
5214  PyObject * obj0 = 0 ;
5215  unsigned long *result = 0 ;
5216 
5217  if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_data",&obj0)) SWIG_fail;
5218  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5219  if (!SWIG_IsOK(res1)) {
5220  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_data" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5221  }
5222  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5223  result = (unsigned long *)(arg1)->data();
5224  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 );
5225  return resultobj;
5226 fail:
5227  return NULL;
5228 }
5229 
5230 
5231 SWIGINTERN PyObject *_wrap_Uint64Vector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5232  PyObject *resultobj = 0;
5233  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5234  void *argp1 = 0 ;
5235  int res1 = 0 ;
5236  PyObject * obj0 = 0 ;
5237  size_t result;
5238 
5239  if (!PyArg_ParseTuple(args,(char *)"O:Uint64Vector_size",&obj0)) SWIG_fail;
5240  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5241  if (!SWIG_IsOK(res1)) {
5242  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_size" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5243  }
5244  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5245  result = (size_t)(arg1)->size();
5246  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5247  return resultobj;
5248 fail:
5249  return NULL;
5250 }
5251 
5252 
5253 SWIGINTERN PyObject *_wrap_Uint64Vector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5254  PyObject *resultobj = 0;
5255  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5256  size_t arg2 ;
5257  void *argp1 = 0 ;
5258  int res1 = 0 ;
5259  size_t val2 ;
5260  int ecode2 = 0 ;
5261  PyObject * obj0 = 0 ;
5262  PyObject * obj1 = 0 ;
5263  unsigned long result;
5264 
5265  if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_at",&obj0,&obj1)) SWIG_fail;
5266  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5267  if (!SWIG_IsOK(res1)) {
5268  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_at" "', argument " "1"" of type '" "std::vector< unsigned long > const *""'");
5269  }
5270  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5271  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5272  if (!SWIG_IsOK(ecode2)) {
5273  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_at" "', argument " "2"" of type '" "size_t""'");
5274  }
5275  arg2 = static_cast< size_t >(val2);
5276  result = (unsigned long)((std::vector< unsigned long > const *)arg1)->at(arg2);
5277  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
5278  return resultobj;
5279 fail:
5280  return NULL;
5281 }
5282 
5283 
5284 SWIGINTERN PyObject *_wrap_Uint64Vector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5285  PyObject *resultobj = 0;
5286  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5287  size_t arg2 ;
5288  void *argp1 = 0 ;
5289  int res1 = 0 ;
5290  size_t val2 ;
5291  int ecode2 = 0 ;
5292  PyObject * obj0 = 0 ;
5293  PyObject * obj1 = 0 ;
5294 
5295  if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_resize",&obj0,&obj1)) SWIG_fail;
5296  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5297  if (!SWIG_IsOK(res1)) {
5298  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_resize" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5299  }
5300  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5301  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5302  if (!SWIG_IsOK(ecode2)) {
5303  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Uint64Vector_resize" "', argument " "2"" of type '" "size_t""'");
5304  }
5305  arg2 = static_cast< size_t >(val2);
5306  (arg1)->resize(arg2);
5307  resultobj = SWIG_Py_Void();
5308  return resultobj;
5309 fail:
5310  return NULL;
5311 }
5312 
5313 
5314 SWIGINTERN PyObject *_wrap_Uint64Vector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5315  PyObject *resultobj = 0;
5316  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5317  std::vector< unsigned long > *arg2 = 0 ;
5318  void *argp1 = 0 ;
5319  int res1 = 0 ;
5320  void *argp2 = 0 ;
5321  int res2 = 0 ;
5322  PyObject * obj0 = 0 ;
5323  PyObject * obj1 = 0 ;
5324 
5325  if (!PyArg_ParseTuple(args,(char *)"OO:Uint64Vector_swap",&obj0,&obj1)) SWIG_fail;
5326  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 | 0 );
5327  if (!SWIG_IsOK(res1)) {
5328  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Uint64Vector_swap" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5329  }
5330  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5331  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_long_t, 0 );
5332  if (!SWIG_IsOK(res2)) {
5333  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'");
5334  }
5335  if (!argp2) {
5336  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Uint64Vector_swap" "', argument " "2"" of type '" "std::vector< unsigned long > &""'");
5337  }
5338  arg2 = reinterpret_cast< std::vector< unsigned long > * >(argp2);
5339  (arg1)->swap(*arg2);
5340  resultobj = SWIG_Py_Void();
5341  return resultobj;
5342 fail:
5343  return NULL;
5344 }
5345 
5346 
5347 SWIGINTERN PyObject *_wrap_delete_Uint64Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5348  PyObject *resultobj = 0;
5349  std::vector< unsigned long > *arg1 = (std::vector< unsigned long > *) 0 ;
5350  void *argp1 = 0 ;
5351  int res1 = 0 ;
5352  PyObject * obj0 = 0 ;
5353 
5354  if (!PyArg_ParseTuple(args,(char *)"O:delete_Uint64Vector",&obj0)) SWIG_fail;
5355  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_POINTER_DISOWN | 0 );
5356  if (!SWIG_IsOK(res1)) {
5357  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Uint64Vector" "', argument " "1"" of type '" "std::vector< unsigned long > *""'");
5358  }
5359  arg1 = reinterpret_cast< std::vector< unsigned long > * >(argp1);
5360  delete arg1;
5361  resultobj = SWIG_Py_Void();
5362  return resultobj;
5363 fail:
5364  return NULL;
5365 }
5366 
5367 
5368 SWIGINTERN PyObject *Uint64Vector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5369  PyObject *obj;
5370  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
5371  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_unsigned_long_t, SWIG_NewClientData(obj));
5372  return SWIG_Py_Void();
5373 }
5374 
5375 SWIGINTERN PyObject *_wrap_new_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5376  PyObject *resultobj = 0;
5377  std::vector< long > *result = 0 ;
5378 
5379  if (!PyArg_ParseTuple(args,(char *)":new_LongVector")) SWIG_fail;
5380  result = (std::vector< long > *)new std::vector< long >();
5381  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_NEW | 0 );
5382  return resultobj;
5383 fail:
5384  return NULL;
5385 }
5386 
5387 
5388 SWIGINTERN PyObject *_wrap_LongVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5389  PyObject *resultobj = 0;
5390  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5391  long arg2 ;
5392  void *argp1 = 0 ;
5393  int res1 = 0 ;
5394  long val2 ;
5395  int ecode2 = 0 ;
5396  PyObject * obj0 = 0 ;
5397  PyObject * obj1 = 0 ;
5398 
5399  if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_push_back",&obj0,&obj1)) SWIG_fail;
5400  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5401  if (!SWIG_IsOK(res1)) {
5402  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_push_back" "', argument " "1"" of type '" "std::vector< long > *""'");
5403  }
5404  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5405  ecode2 = SWIG_AsVal_long(obj1, &val2);
5406  if (!SWIG_IsOK(ecode2)) {
5407  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_push_back" "', argument " "2"" of type '" "long""'");
5408  }
5409  arg2 = static_cast< long >(val2);
5410  (arg1)->push_back(arg2);
5411  resultobj = SWIG_Py_Void();
5412  return resultobj;
5413 fail:
5414  return NULL;
5415 }
5416 
5417 
5418 SWIGINTERN PyObject *_wrap_LongVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5419  PyObject *resultobj = 0;
5420  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5421  void *argp1 = 0 ;
5422  int res1 = 0 ;
5423  PyObject * obj0 = 0 ;
5424 
5425  if (!PyArg_ParseTuple(args,(char *)"O:LongVector_clear",&obj0)) SWIG_fail;
5426  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5427  if (!SWIG_IsOK(res1)) {
5428  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_clear" "', argument " "1"" of type '" "std::vector< long > *""'");
5429  }
5430  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5431  (arg1)->clear();
5432  resultobj = SWIG_Py_Void();
5433  return resultobj;
5434 fail:
5435  return NULL;
5436 }
5437 
5438 
5439 SWIGINTERN PyObject *_wrap_LongVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5440  PyObject *resultobj = 0;
5441  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5442  void *argp1 = 0 ;
5443  int res1 = 0 ;
5444  PyObject * obj0 = 0 ;
5445  long *result = 0 ;
5446 
5447  if (!PyArg_ParseTuple(args,(char *)"O:LongVector_data",&obj0)) SWIG_fail;
5448  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5449  if (!SWIG_IsOK(res1)) {
5450  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_data" "', argument " "1"" of type '" "std::vector< long > *""'");
5451  }
5452  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5453  result = (long *)(arg1)->data();
5454  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_long, 0 | 0 );
5455  return resultobj;
5456 fail:
5457  return NULL;
5458 }
5459 
5460 
5461 SWIGINTERN PyObject *_wrap_LongVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5462  PyObject *resultobj = 0;
5463  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5464  void *argp1 = 0 ;
5465  int res1 = 0 ;
5466  PyObject * obj0 = 0 ;
5467  size_t result;
5468 
5469  if (!PyArg_ParseTuple(args,(char *)"O:LongVector_size",&obj0)) SWIG_fail;
5470  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5471  if (!SWIG_IsOK(res1)) {
5472  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_size" "', argument " "1"" of type '" "std::vector< long > *""'");
5473  }
5474  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5475  result = (size_t)(arg1)->size();
5476  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5477  return resultobj;
5478 fail:
5479  return NULL;
5480 }
5481 
5482 
5483 SWIGINTERN PyObject *_wrap_LongVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5484  PyObject *resultobj = 0;
5485  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5486  size_t arg2 ;
5487  void *argp1 = 0 ;
5488  int res1 = 0 ;
5489  size_t val2 ;
5490  int ecode2 = 0 ;
5491  PyObject * obj0 = 0 ;
5492  PyObject * obj1 = 0 ;
5493  long result;
5494 
5495  if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_at",&obj0,&obj1)) SWIG_fail;
5496  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5497  if (!SWIG_IsOK(res1)) {
5498  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_at" "', argument " "1"" of type '" "std::vector< long > const *""'");
5499  }
5500  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5501  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5502  if (!SWIG_IsOK(ecode2)) {
5503  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_at" "', argument " "2"" of type '" "size_t""'");
5504  }
5505  arg2 = static_cast< size_t >(val2);
5506  result = (long)((std::vector< long > const *)arg1)->at(arg2);
5507  resultobj = SWIG_From_long(static_cast< long >(result));
5508  return resultobj;
5509 fail:
5510  return NULL;
5511 }
5512 
5513 
5514 SWIGINTERN PyObject *_wrap_LongVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5515  PyObject *resultobj = 0;
5516  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5517  size_t arg2 ;
5518  void *argp1 = 0 ;
5519  int res1 = 0 ;
5520  size_t val2 ;
5521  int ecode2 = 0 ;
5522  PyObject * obj0 = 0 ;
5523  PyObject * obj1 = 0 ;
5524 
5525  if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_resize",&obj0,&obj1)) SWIG_fail;
5526  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5527  if (!SWIG_IsOK(res1)) {
5528  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_resize" "', argument " "1"" of type '" "std::vector< long > *""'");
5529  }
5530  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5531  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5532  if (!SWIG_IsOK(ecode2)) {
5533  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVector_resize" "', argument " "2"" of type '" "size_t""'");
5534  }
5535  arg2 = static_cast< size_t >(val2);
5536  (arg1)->resize(arg2);
5537  resultobj = SWIG_Py_Void();
5538  return resultobj;
5539 fail:
5540  return NULL;
5541 }
5542 
5543 
5544 SWIGINTERN PyObject *_wrap_LongVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5545  PyObject *resultobj = 0;
5546  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5547  std::vector< long > *arg2 = 0 ;
5548  void *argp1 = 0 ;
5549  int res1 = 0 ;
5550  void *argp2 = 0 ;
5551  int res2 = 0 ;
5552  PyObject * obj0 = 0 ;
5553  PyObject * obj1 = 0 ;
5554 
5555  if (!PyArg_ParseTuple(args,(char *)"OO:LongVector_swap",&obj0,&obj1)) SWIG_fail;
5556  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
5557  if (!SWIG_IsOK(res1)) {
5558  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVector_swap" "', argument " "1"" of type '" "std::vector< long > *""'");
5559  }
5560  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5561  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 );
5562  if (!SWIG_IsOK(res2)) {
5563  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'");
5564  }
5565  if (!argp2) {
5566  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVector_swap" "', argument " "2"" of type '" "std::vector< long > &""'");
5567  }
5568  arg2 = reinterpret_cast< std::vector< long > * >(argp2);
5569  (arg1)->swap(*arg2);
5570  resultobj = SWIG_Py_Void();
5571  return resultobj;
5572 fail:
5573  return NULL;
5574 }
5575 
5576 
5577 SWIGINTERN PyObject *_wrap_delete_LongVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5578  PyObject *resultobj = 0;
5579  std::vector< long > *arg1 = (std::vector< long > *) 0 ;
5580  void *argp1 = 0 ;
5581  int res1 = 0 ;
5582  PyObject * obj0 = 0 ;
5583 
5584  if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVector",&obj0)) SWIG_fail;
5585  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_DISOWN | 0 );
5586  if (!SWIG_IsOK(res1)) {
5587  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVector" "', argument " "1"" of type '" "std::vector< long > *""'");
5588  }
5589  arg1 = reinterpret_cast< std::vector< long > * >(argp1);
5590  delete arg1;
5591  resultobj = SWIG_Py_Void();
5592  return resultobj;
5593 fail:
5594  return NULL;
5595 }
5596 
5597 
5598 SWIGINTERN PyObject *LongVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5599  PyObject *obj;
5600  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
5601  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_long_t, SWIG_NewClientData(obj));
5602  return SWIG_Py_Void();
5603 }
5604 
5605 SWIGINTERN PyObject *_wrap_new_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5606  PyObject *resultobj = 0;
5607  std::vector< int > *result = 0 ;
5608 
5609  if (!PyArg_ParseTuple(args,(char *)":new_IntVector")) SWIG_fail;
5610  result = (std::vector< int > *)new std::vector< int >();
5611  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_NEW | 0 );
5612  return resultobj;
5613 fail:
5614  return NULL;
5615 }
5616 
5617 
5618 SWIGINTERN PyObject *_wrap_IntVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5619  PyObject *resultobj = 0;
5620  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5621  int arg2 ;
5622  void *argp1 = 0 ;
5623  int res1 = 0 ;
5624  int val2 ;
5625  int ecode2 = 0 ;
5626  PyObject * obj0 = 0 ;
5627  PyObject * obj1 = 0 ;
5628 
5629  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_push_back",&obj0,&obj1)) SWIG_fail;
5630  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5631  if (!SWIG_IsOK(res1)) {
5632  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_push_back" "', argument " "1"" of type '" "std::vector< int > *""'");
5633  }
5634  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5635  ecode2 = SWIG_AsVal_int(obj1, &val2);
5636  if (!SWIG_IsOK(ecode2)) {
5637  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_push_back" "', argument " "2"" of type '" "int""'");
5638  }
5639  arg2 = static_cast< int >(val2);
5640  (arg1)->push_back(arg2);
5641  resultobj = SWIG_Py_Void();
5642  return resultobj;
5643 fail:
5644  return NULL;
5645 }
5646 
5647 
5648 SWIGINTERN PyObject *_wrap_IntVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5649  PyObject *resultobj = 0;
5650  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5651  void *argp1 = 0 ;
5652  int res1 = 0 ;
5653  PyObject * obj0 = 0 ;
5654 
5655  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_clear",&obj0)) SWIG_fail;
5656  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5657  if (!SWIG_IsOK(res1)) {
5658  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_clear" "', argument " "1"" of type '" "std::vector< int > *""'");
5659  }
5660  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5661  (arg1)->clear();
5662  resultobj = SWIG_Py_Void();
5663  return resultobj;
5664 fail:
5665  return NULL;
5666 }
5667 
5668 
5669 SWIGINTERN PyObject *_wrap_IntVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5670  PyObject *resultobj = 0;
5671  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5672  void *argp1 = 0 ;
5673  int res1 = 0 ;
5674  PyObject * obj0 = 0 ;
5675  int *result = 0 ;
5676 
5677  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_data",&obj0)) SWIG_fail;
5678  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5679  if (!SWIG_IsOK(res1)) {
5680  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_data" "', argument " "1"" of type '" "std::vector< int > *""'");
5681  }
5682  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5683  result = (int *)(arg1)->data();
5684  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 | 0 );
5685  return resultobj;
5686 fail:
5687  return NULL;
5688 }
5689 
5690 
5691 SWIGINTERN PyObject *_wrap_IntVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5692  PyObject *resultobj = 0;
5693  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5694  void *argp1 = 0 ;
5695  int res1 = 0 ;
5696  PyObject * obj0 = 0 ;
5697  size_t result;
5698 
5699  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_size",&obj0)) SWIG_fail;
5700  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5701  if (!SWIG_IsOK(res1)) {
5702  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_size" "', argument " "1"" of type '" "std::vector< int > *""'");
5703  }
5704  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5705  result = (size_t)(arg1)->size();
5706  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5707  return resultobj;
5708 fail:
5709  return NULL;
5710 }
5711 
5712 
5713 SWIGINTERN PyObject *_wrap_IntVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5714  PyObject *resultobj = 0;
5715  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5716  size_t arg2 ;
5717  void *argp1 = 0 ;
5718  int res1 = 0 ;
5719  size_t val2 ;
5720  int ecode2 = 0 ;
5721  PyObject * obj0 = 0 ;
5722  PyObject * obj1 = 0 ;
5723  int result;
5724 
5725  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_at",&obj0,&obj1)) SWIG_fail;
5726  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5727  if (!SWIG_IsOK(res1)) {
5728  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_at" "', argument " "1"" of type '" "std::vector< int > const *""'");
5729  }
5730  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5731  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5732  if (!SWIG_IsOK(ecode2)) {
5733  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_at" "', argument " "2"" of type '" "size_t""'");
5734  }
5735  arg2 = static_cast< size_t >(val2);
5736  result = (int)((std::vector< int > const *)arg1)->at(arg2);
5737  resultobj = SWIG_From_int(static_cast< int >(result));
5738  return resultobj;
5739 fail:
5740  return NULL;
5741 }
5742 
5743 
5744 SWIGINTERN PyObject *_wrap_IntVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5745  PyObject *resultobj = 0;
5746  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5747  size_t arg2 ;
5748  void *argp1 = 0 ;
5749  int res1 = 0 ;
5750  size_t val2 ;
5751  int ecode2 = 0 ;
5752  PyObject * obj0 = 0 ;
5753  PyObject * obj1 = 0 ;
5754 
5755  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_resize",&obj0,&obj1)) SWIG_fail;
5756  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5757  if (!SWIG_IsOK(res1)) {
5758  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_resize" "', argument " "1"" of type '" "std::vector< int > *""'");
5759  }
5760  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5761  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5762  if (!SWIG_IsOK(ecode2)) {
5763  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_resize" "', argument " "2"" of type '" "size_t""'");
5764  }
5765  arg2 = static_cast< size_t >(val2);
5766  (arg1)->resize(arg2);
5767  resultobj = SWIG_Py_Void();
5768  return resultobj;
5769 fail:
5770  return NULL;
5771 }
5772 
5773 
5774 SWIGINTERN PyObject *_wrap_IntVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5775  PyObject *resultobj = 0;
5776  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5777  std::vector< int > *arg2 = 0 ;
5778  void *argp1 = 0 ;
5779  int res1 = 0 ;
5780  void *argp2 = 0 ;
5781  int res2 = 0 ;
5782  PyObject * obj0 = 0 ;
5783  PyObject * obj1 = 0 ;
5784 
5785  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_swap",&obj0,&obj1)) SWIG_fail;
5786  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
5787  if (!SWIG_IsOK(res1)) {
5788  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_swap" "', argument " "1"" of type '" "std::vector< int > *""'");
5789  }
5790  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5791  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_t, 0 );
5792  if (!SWIG_IsOK(res2)) {
5793  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'");
5794  }
5795  if (!argp2) {
5796  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'");
5797  }
5798  arg2 = reinterpret_cast< std::vector< int > * >(argp2);
5799  (arg1)->swap(*arg2);
5800  resultobj = SWIG_Py_Void();
5801  return resultobj;
5802 fail:
5803  return NULL;
5804 }
5805 
5806 
5807 SWIGINTERN PyObject *_wrap_delete_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5808  PyObject *resultobj = 0;
5809  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
5810  void *argp1 = 0 ;
5811  int res1 = 0 ;
5812  PyObject * obj0 = 0 ;
5813 
5814  if (!PyArg_ParseTuple(args,(char *)"O:delete_IntVector",&obj0)) SWIG_fail;
5815  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_t, SWIG_POINTER_DISOWN | 0 );
5816  if (!SWIG_IsOK(res1)) {
5817  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntVector" "', argument " "1"" of type '" "std::vector< int > *""'");
5818  }
5819  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
5820  delete arg1;
5821  resultobj = SWIG_Py_Void();
5822  return resultobj;
5823 fail:
5824  return NULL;
5825 }
5826 
5827 
5828 SWIGINTERN PyObject *IntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5829  PyObject *obj;
5830  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
5831  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_int_t, SWIG_NewClientData(obj));
5832  return SWIG_Py_Void();
5833 }
5834 
5835 SWIGINTERN PyObject *_wrap_new_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5836  PyObject *resultobj = 0;
5837  std::vector< faiss::VectorTransform * > *result = 0 ;
5838 
5839  if (!PyArg_ParseTuple(args,(char *)":new_VectorTransformVector")) SWIG_fail;
5840  result = (std::vector< faiss::VectorTransform * > *)new std::vector< faiss::VectorTransform * >();
5841  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_NEW | 0 );
5842  return resultobj;
5843 fail:
5844  return NULL;
5845 }
5846 
5847 
5848 SWIGINTERN PyObject *_wrap_VectorTransformVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5849  PyObject *resultobj = 0;
5850  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5852  void *argp1 = 0 ;
5853  int res1 = 0 ;
5854  void *argp2 = 0 ;
5855  int res2 = 0 ;
5856  PyObject * obj0 = 0 ;
5857  PyObject * obj1 = 0 ;
5858 
5859  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_push_back",&obj0,&obj1)) SWIG_fail;
5860  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5861  if (!SWIG_IsOK(res1)) {
5862  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
5863  }
5864  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5865  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
5866  if (!SWIG_IsOK(res2)) {
5867  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_push_back" "', argument " "2"" of type '" "faiss::VectorTransform *""'");
5868  }
5869  arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2);
5870  (arg1)->push_back(arg2);
5871  resultobj = SWIG_Py_Void();
5872  return resultobj;
5873 fail:
5874  return NULL;
5875 }
5876 
5877 
5878 SWIGINTERN PyObject *_wrap_VectorTransformVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5879  PyObject *resultobj = 0;
5880  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5881  void *argp1 = 0 ;
5882  int res1 = 0 ;
5883  PyObject * obj0 = 0 ;
5884 
5885  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_clear",&obj0)) SWIG_fail;
5886  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5887  if (!SWIG_IsOK(res1)) {
5888  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_clear" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
5889  }
5890  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5891  (arg1)->clear();
5892  resultobj = SWIG_Py_Void();
5893  return resultobj;
5894 fail:
5895  return NULL;
5896 }
5897 
5898 
5899 SWIGINTERN PyObject *_wrap_VectorTransformVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5900  PyObject *resultobj = 0;
5901  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5902  void *argp1 = 0 ;
5903  int res1 = 0 ;
5904  PyObject * obj0 = 0 ;
5905  faiss::VectorTransform **result = 0 ;
5906 
5907  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_data",&obj0)) SWIG_fail;
5908  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5909  if (!SWIG_IsOK(res1)) {
5910  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_data" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
5911  }
5912  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5913  result = (faiss::VectorTransform **)(arg1)->data();
5914  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__VectorTransform, 0 | 0 );
5915  return resultobj;
5916 fail:
5917  return NULL;
5918 }
5919 
5920 
5921 SWIGINTERN PyObject *_wrap_VectorTransformVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5922  PyObject *resultobj = 0;
5923  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5924  void *argp1 = 0 ;
5925  int res1 = 0 ;
5926  PyObject * obj0 = 0 ;
5927  size_t result;
5928 
5929  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransformVector_size",&obj0)) SWIG_fail;
5930  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5931  if (!SWIG_IsOK(res1)) {
5932  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_size" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
5933  }
5934  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5935  result = (size_t)(arg1)->size();
5936  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
5937  return resultobj;
5938 fail:
5939  return NULL;
5940 }
5941 
5942 
5943 SWIGINTERN PyObject *_wrap_VectorTransformVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5944  PyObject *resultobj = 0;
5945  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5946  size_t arg2 ;
5947  void *argp1 = 0 ;
5948  int res1 = 0 ;
5949  size_t val2 ;
5950  int ecode2 = 0 ;
5951  PyObject * obj0 = 0 ;
5952  PyObject * obj1 = 0 ;
5953  faiss::VectorTransform *result = 0 ;
5954 
5955  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_at",&obj0,&obj1)) SWIG_fail;
5956  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5957  if (!SWIG_IsOK(res1)) {
5958  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_at" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > const *""'");
5959  }
5960  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5961  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5962  if (!SWIG_IsOK(ecode2)) {
5963  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_at" "', argument " "2"" of type '" "size_t""'");
5964  }
5965  arg2 = static_cast< size_t >(val2);
5966  result = (faiss::VectorTransform *)((std::vector< faiss::VectorTransform * > const *)arg1)->at(arg2);
5967  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
5968  return resultobj;
5969 fail:
5970  return NULL;
5971 }
5972 
5973 
5974 SWIGINTERN PyObject *_wrap_VectorTransformVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5975  PyObject *resultobj = 0;
5976  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
5977  size_t arg2 ;
5978  void *argp1 = 0 ;
5979  int res1 = 0 ;
5980  size_t val2 ;
5981  int ecode2 = 0 ;
5982  PyObject * obj0 = 0 ;
5983  PyObject * obj1 = 0 ;
5984 
5985  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_resize",&obj0,&obj1)) SWIG_fail;
5986  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
5987  if (!SWIG_IsOK(res1)) {
5988  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_resize" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
5989  }
5990  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
5991  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5992  if (!SWIG_IsOK(ecode2)) {
5993  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransformVector_resize" "', argument " "2"" of type '" "size_t""'");
5994  }
5995  arg2 = static_cast< size_t >(val2);
5996  (arg1)->resize(arg2);
5997  resultobj = SWIG_Py_Void();
5998  return resultobj;
5999 fail:
6000  return NULL;
6001 }
6002 
6003 
6004 SWIGINTERN PyObject *_wrap_VectorTransformVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6005  PyObject *resultobj = 0;
6006  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
6007  std::vector< faiss::VectorTransform * > *arg2 = 0 ;
6008  void *argp1 = 0 ;
6009  int res1 = 0 ;
6010  void *argp2 = 0 ;
6011  int res2 = 0 ;
6012  PyObject * obj0 = 0 ;
6013  PyObject * obj1 = 0 ;
6014 
6015  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransformVector_swap",&obj0,&obj1)) SWIG_fail;
6016  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
6017  if (!SWIG_IsOK(res1)) {
6018  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransformVector_swap" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
6019  }
6020  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
6021  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 );
6022  if (!SWIG_IsOK(res2)) {
6023  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'");
6024  }
6025  if (!argp2) {
6026  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorTransformVector_swap" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > &""'");
6027  }
6028  arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2);
6029  (arg1)->swap(*arg2);
6030  resultobj = SWIG_Py_Void();
6031  return resultobj;
6032 fail:
6033  return NULL;
6034 }
6035 
6036 
6037 SWIGINTERN PyObject *_wrap_delete_VectorTransformVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6038  PyObject *resultobj = 0;
6039  std::vector< faiss::VectorTransform * > *arg1 = (std::vector< faiss::VectorTransform * > *) 0 ;
6040  void *argp1 = 0 ;
6041  int res1 = 0 ;
6042  PyObject * obj0 = 0 ;
6043 
6044  if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransformVector",&obj0)) SWIG_fail;
6045  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_POINTER_DISOWN | 0 );
6046  if (!SWIG_IsOK(res1)) {
6047  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransformVector" "', argument " "1"" of type '" "std::vector< faiss::VectorTransform * > *""'");
6048  }
6049  arg1 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp1);
6050  delete arg1;
6051  resultobj = SWIG_Py_Void();
6052  return resultobj;
6053 fail:
6054  return NULL;
6055 }
6056 
6057 
6058 SWIGINTERN PyObject *VectorTransformVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6059  PyObject *obj;
6060  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
6061  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, SWIG_NewClientData(obj));
6062  return SWIG_Py_Void();
6063 }
6064 
6065 SWIGINTERN PyObject *_wrap_new_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6066  PyObject *resultobj = 0;
6067  std::vector< faiss::OperatingPoint > *result = 0 ;
6068 
6069  if (!PyArg_ParseTuple(args,(char *)":new_OperatingPointVector")) SWIG_fail;
6070  result = (std::vector< faiss::OperatingPoint > *)new std::vector< faiss::OperatingPoint >();
6071  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_NEW | 0 );
6072  return resultobj;
6073 fail:
6074  return NULL;
6075 }
6076 
6077 
6078 SWIGINTERN PyObject *_wrap_OperatingPointVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6079  PyObject *resultobj = 0;
6080  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6081  faiss::OperatingPoint arg2 ;
6082  void *argp1 = 0 ;
6083  int res1 = 0 ;
6084  void *argp2 ;
6085  int res2 = 0 ;
6086  PyObject * obj0 = 0 ;
6087  PyObject * obj1 = 0 ;
6088 
6089  if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_push_back",&obj0,&obj1)) SWIG_fail;
6090  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6091  if (!SWIG_IsOK(res1)) {
6092  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6093  }
6094  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6095  {
6096  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__OperatingPoint, 0 | 0);
6097  if (!SWIG_IsOK(res2)) {
6098  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'");
6099  }
6100  if (!argp2) {
6101  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_push_back" "', argument " "2"" of type '" "faiss::OperatingPoint""'");
6102  } else {
6103  faiss::OperatingPoint * temp = reinterpret_cast< faiss::OperatingPoint * >(argp2);
6104  arg2 = *temp;
6105  if (SWIG_IsNewObj(res2)) delete temp;
6106  }
6107  }
6108  (arg1)->push_back(arg2);
6109  resultobj = SWIG_Py_Void();
6110  return resultobj;
6111 fail:
6112  return NULL;
6113 }
6114 
6115 
6116 SWIGINTERN PyObject *_wrap_OperatingPointVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6117  PyObject *resultobj = 0;
6118  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6119  void *argp1 = 0 ;
6120  int res1 = 0 ;
6121  PyObject * obj0 = 0 ;
6122 
6123  if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_clear",&obj0)) SWIG_fail;
6124  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6125  if (!SWIG_IsOK(res1)) {
6126  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_clear" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6127  }
6128  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6129  (arg1)->clear();
6130  resultobj = SWIG_Py_Void();
6131  return resultobj;
6132 fail:
6133  return NULL;
6134 }
6135 
6136 
6137 SWIGINTERN PyObject *_wrap_OperatingPointVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6138  PyObject *resultobj = 0;
6139  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6140  void *argp1 = 0 ;
6141  int res1 = 0 ;
6142  PyObject * obj0 = 0 ;
6143  faiss::OperatingPoint *result = 0 ;
6144 
6145  if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_data",&obj0)) SWIG_fail;
6146  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6147  if (!SWIG_IsOK(res1)) {
6148  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_data" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6149  }
6150  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6151  result = (faiss::OperatingPoint *)(arg1)->data();
6152  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OperatingPoint, 0 | 0 );
6153  return resultobj;
6154 fail:
6155  return NULL;
6156 }
6157 
6158 
6159 SWIGINTERN PyObject *_wrap_OperatingPointVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6160  PyObject *resultobj = 0;
6161  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6162  void *argp1 = 0 ;
6163  int res1 = 0 ;
6164  PyObject * obj0 = 0 ;
6165  size_t result;
6166 
6167  if (!PyArg_ParseTuple(args,(char *)"O:OperatingPointVector_size",&obj0)) SWIG_fail;
6168  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6169  if (!SWIG_IsOK(res1)) {
6170  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_size" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6171  }
6172  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6173  result = (size_t)(arg1)->size();
6174  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6175  return resultobj;
6176 fail:
6177  return NULL;
6178 }
6179 
6180 
6181 SWIGINTERN PyObject *_wrap_OperatingPointVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6182  PyObject *resultobj = 0;
6183  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6184  size_t arg2 ;
6185  void *argp1 = 0 ;
6186  int res1 = 0 ;
6187  size_t val2 ;
6188  int ecode2 = 0 ;
6189  PyObject * obj0 = 0 ;
6190  PyObject * obj1 = 0 ;
6191  faiss::OperatingPoint result;
6192 
6193  if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_at",&obj0,&obj1)) SWIG_fail;
6194  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6195  if (!SWIG_IsOK(res1)) {
6196  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_at" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > const *""'");
6197  }
6198  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6199  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6200  if (!SWIG_IsOK(ecode2)) {
6201  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_at" "', argument " "2"" of type '" "size_t""'");
6202  }
6203  arg2 = static_cast< size_t >(val2);
6204  result = ((std::vector< faiss::OperatingPoint > const *)arg1)->at(arg2);
6205  resultobj = SWIG_NewPointerObj((new faiss::OperatingPoint(static_cast< const faiss::OperatingPoint& >(result))), SWIGTYPE_p_faiss__OperatingPoint, SWIG_POINTER_OWN | 0 );
6206  return resultobj;
6207 fail:
6208  return NULL;
6209 }
6210 
6211 
6212 SWIGINTERN PyObject *_wrap_OperatingPointVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6213  PyObject *resultobj = 0;
6214  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6215  size_t arg2 ;
6216  void *argp1 = 0 ;
6217  int res1 = 0 ;
6218  size_t val2 ;
6219  int ecode2 = 0 ;
6220  PyObject * obj0 = 0 ;
6221  PyObject * obj1 = 0 ;
6222 
6223  if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_resize",&obj0,&obj1)) SWIG_fail;
6224  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6225  if (!SWIG_IsOK(res1)) {
6226  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_resize" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6227  }
6228  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6229  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6230  if (!SWIG_IsOK(ecode2)) {
6231  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OperatingPointVector_resize" "', argument " "2"" of type '" "size_t""'");
6232  }
6233  arg2 = static_cast< size_t >(val2);
6234  (arg1)->resize(arg2);
6235  resultobj = SWIG_Py_Void();
6236  return resultobj;
6237 fail:
6238  return NULL;
6239 }
6240 
6241 
6242 SWIGINTERN PyObject *_wrap_OperatingPointVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6243  PyObject *resultobj = 0;
6244  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6245  std::vector< faiss::OperatingPoint > *arg2 = 0 ;
6246  void *argp1 = 0 ;
6247  int res1 = 0 ;
6248  void *argp2 = 0 ;
6249  int res2 = 0 ;
6250  PyObject * obj0 = 0 ;
6251  PyObject * obj1 = 0 ;
6252 
6253  if (!PyArg_ParseTuple(args,(char *)"OO:OperatingPointVector_swap",&obj0,&obj1)) SWIG_fail;
6254  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 | 0 );
6255  if (!SWIG_IsOK(res1)) {
6256  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OperatingPointVector_swap" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6257  }
6258  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6259  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, 0 );
6260  if (!SWIG_IsOK(res2)) {
6261  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'");
6262  }
6263  if (!argp2) {
6264  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "OperatingPointVector_swap" "', argument " "2"" of type '" "std::vector< faiss::OperatingPoint > &""'");
6265  }
6266  arg2 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp2);
6267  (arg1)->swap(*arg2);
6268  resultobj = SWIG_Py_Void();
6269  return resultobj;
6270 fail:
6271  return NULL;
6272 }
6273 
6274 
6275 SWIGINTERN PyObject *_wrap_delete_OperatingPointVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6276  PyObject *resultobj = 0;
6277  std::vector< faiss::OperatingPoint > *arg1 = (std::vector< faiss::OperatingPoint > *) 0 ;
6278  void *argp1 = 0 ;
6279  int res1 = 0 ;
6280  PyObject * obj0 = 0 ;
6281 
6282  if (!PyArg_ParseTuple(args,(char *)"O:delete_OperatingPointVector",&obj0)) SWIG_fail;
6283  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_POINTER_DISOWN | 0 );
6284  if (!SWIG_IsOK(res1)) {
6285  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OperatingPointVector" "', argument " "1"" of type '" "std::vector< faiss::OperatingPoint > *""'");
6286  }
6287  arg1 = reinterpret_cast< std::vector< faiss::OperatingPoint > * >(argp1);
6288  delete arg1;
6289  resultobj = SWIG_Py_Void();
6290  return resultobj;
6291 fail:
6292  return NULL;
6293 }
6294 
6295 
6296 SWIGINTERN PyObject *OperatingPointVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6297  PyObject *obj;
6298  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
6299  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__OperatingPoint_t, SWIG_NewClientData(obj));
6300  return SWIG_Py_Void();
6301 }
6302 
6303 SWIGINTERN PyObject *_wrap_new_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6304  PyObject *resultobj = 0;
6305  std::vector< faiss::InvertedLists * > *result = 0 ;
6306 
6307  if (!PyArg_ParseTuple(args,(char *)":new_InvertedListsPtrVector")) SWIG_fail;
6308  result = (std::vector< faiss::InvertedLists * > *)new std::vector< faiss::InvertedLists * >();
6309  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_NEW | 0 );
6310  return resultobj;
6311 fail:
6312  return NULL;
6313 }
6314 
6315 
6316 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6317  PyObject *resultobj = 0;
6318  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6320  void *argp1 = 0 ;
6321  int res1 = 0 ;
6322  void *argp2 = 0 ;
6323  int res2 = 0 ;
6324  PyObject * obj0 = 0 ;
6325  PyObject * obj1 = 0 ;
6326 
6327  if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_push_back",&obj0,&obj1)) SWIG_fail;
6328  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6329  if (!SWIG_IsOK(res1)) {
6330  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_push_back" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6331  }
6332  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6333  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__InvertedLists, 0 | 0 );
6334  if (!SWIG_IsOK(res2)) {
6335  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_push_back" "', argument " "2"" of type '" "faiss::InvertedLists *""'");
6336  }
6337  arg2 = reinterpret_cast< faiss::InvertedLists * >(argp2);
6338  (arg1)->push_back(arg2);
6339  resultobj = SWIG_Py_Void();
6340  return resultobj;
6341 fail:
6342  return NULL;
6343 }
6344 
6345 
6346 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6347  PyObject *resultobj = 0;
6348  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6349  void *argp1 = 0 ;
6350  int res1 = 0 ;
6351  PyObject * obj0 = 0 ;
6352 
6353  if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_clear",&obj0)) SWIG_fail;
6354  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6355  if (!SWIG_IsOK(res1)) {
6356  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_clear" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6357  }
6358  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6359  (arg1)->clear();
6360  resultobj = SWIG_Py_Void();
6361  return resultobj;
6362 fail:
6363  return NULL;
6364 }
6365 
6366 
6367 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6368  PyObject *resultobj = 0;
6369  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6370  void *argp1 = 0 ;
6371  int res1 = 0 ;
6372  PyObject * obj0 = 0 ;
6373  faiss::InvertedLists **result = 0 ;
6374 
6375  if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_data",&obj0)) SWIG_fail;
6376  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6377  if (!SWIG_IsOK(res1)) {
6378  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_data" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6379  }
6380  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6381  result = (faiss::InvertedLists **)(arg1)->data();
6382  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_faiss__InvertedLists, 0 | 0 );
6383  return resultobj;
6384 fail:
6385  return NULL;
6386 }
6387 
6388 
6389 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6390  PyObject *resultobj = 0;
6391  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6392  void *argp1 = 0 ;
6393  int res1 = 0 ;
6394  PyObject * obj0 = 0 ;
6395  size_t result;
6396 
6397  if (!PyArg_ParseTuple(args,(char *)"O:InvertedListsPtrVector_size",&obj0)) SWIG_fail;
6398  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6399  if (!SWIG_IsOK(res1)) {
6400  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_size" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6401  }
6402  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6403  result = (size_t)(arg1)->size();
6404  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6405  return resultobj;
6406 fail:
6407  return NULL;
6408 }
6409 
6410 
6411 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6412  PyObject *resultobj = 0;
6413  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6414  size_t arg2 ;
6415  void *argp1 = 0 ;
6416  int res1 = 0 ;
6417  size_t val2 ;
6418  int ecode2 = 0 ;
6419  PyObject * obj0 = 0 ;
6420  PyObject * obj1 = 0 ;
6421  faiss::InvertedLists *result = 0 ;
6422 
6423  if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_at",&obj0,&obj1)) SWIG_fail;
6424  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6425  if (!SWIG_IsOK(res1)) {
6426  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_at" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > const *""'");
6427  }
6428  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6429  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6430  if (!SWIG_IsOK(ecode2)) {
6431  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_at" "', argument " "2"" of type '" "size_t""'");
6432  }
6433  arg2 = static_cast< size_t >(val2);
6434  result = (faiss::InvertedLists *)((std::vector< faiss::InvertedLists * > const *)arg1)->at(arg2);
6435  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__InvertedLists, 0 | 0 );
6436  return resultobj;
6437 fail:
6438  return NULL;
6439 }
6440 
6441 
6442 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6443  PyObject *resultobj = 0;
6444  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6445  size_t arg2 ;
6446  void *argp1 = 0 ;
6447  int res1 = 0 ;
6448  size_t val2 ;
6449  int ecode2 = 0 ;
6450  PyObject * obj0 = 0 ;
6451  PyObject * obj1 = 0 ;
6452 
6453  if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_resize",&obj0,&obj1)) SWIG_fail;
6454  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6455  if (!SWIG_IsOK(res1)) {
6456  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_resize" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6457  }
6458  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6459  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6460  if (!SWIG_IsOK(ecode2)) {
6461  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "InvertedListsPtrVector_resize" "', argument " "2"" of type '" "size_t""'");
6462  }
6463  arg2 = static_cast< size_t >(val2);
6464  (arg1)->resize(arg2);
6465  resultobj = SWIG_Py_Void();
6466  return resultobj;
6467 fail:
6468  return NULL;
6469 }
6470 
6471 
6472 SWIGINTERN PyObject *_wrap_InvertedListsPtrVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6473  PyObject *resultobj = 0;
6474  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6475  std::vector< faiss::InvertedLists * > *arg2 = 0 ;
6476  void *argp1 = 0 ;
6477  int res1 = 0 ;
6478  void *argp2 = 0 ;
6479  int res2 = 0 ;
6480  PyObject * obj0 = 0 ;
6481  PyObject * obj1 = 0 ;
6482 
6483  if (!PyArg_ParseTuple(args,(char *)"OO:InvertedListsPtrVector_swap",&obj0,&obj1)) SWIG_fail;
6484  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 | 0 );
6485  if (!SWIG_IsOK(res1)) {
6486  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InvertedListsPtrVector_swap" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6487  }
6488  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6489  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, 0 );
6490  if (!SWIG_IsOK(res2)) {
6491  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'");
6492  }
6493  if (!argp2) {
6494  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "InvertedListsPtrVector_swap" "', argument " "2"" of type '" "std::vector< faiss::InvertedLists * > &""'");
6495  }
6496  arg2 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp2);
6497  (arg1)->swap(*arg2);
6498  resultobj = SWIG_Py_Void();
6499  return resultobj;
6500 fail:
6501  return NULL;
6502 }
6503 
6504 
6505 SWIGINTERN PyObject *_wrap_delete_InvertedListsPtrVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6506  PyObject *resultobj = 0;
6507  std::vector< faiss::InvertedLists * > *arg1 = (std::vector< faiss::InvertedLists * > *) 0 ;
6508  void *argp1 = 0 ;
6509  int res1 = 0 ;
6510  PyObject * obj0 = 0 ;
6511 
6512  if (!PyArg_ParseTuple(args,(char *)"O:delete_InvertedListsPtrVector",&obj0)) SWIG_fail;
6513  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_POINTER_DISOWN | 0 );
6514  if (!SWIG_IsOK(res1)) {
6515  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_InvertedListsPtrVector" "', argument " "1"" of type '" "std::vector< faiss::InvertedLists * > *""'");
6516  }
6517  arg1 = reinterpret_cast< std::vector< faiss::InvertedLists * > * >(argp1);
6518  delete arg1;
6519  resultobj = SWIG_Py_Void();
6520  return resultobj;
6521 fail:
6522  return NULL;
6523 }
6524 
6525 
6526 SWIGINTERN PyObject *InvertedListsPtrVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6527  PyObject *obj;
6528  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
6529  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_faiss__InvertedLists_p_t, SWIG_NewClientData(obj));
6530  return SWIG_Py_Void();
6531 }
6532 
6533 SWIGINTERN PyObject *_wrap_new_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6534  PyObject *resultobj = 0;
6535  std::vector< std::vector< float > > *result = 0 ;
6536 
6537  if (!PyArg_ParseTuple(args,(char *)":new_FloatVectorVector")) SWIG_fail;
6538  result = (std::vector< std::vector< float > > *)new std::vector< std::vector< float > >();
6539  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_NEW | 0 );
6540  return resultobj;
6541 fail:
6542  return NULL;
6543 }
6544 
6545 
6546 SWIGINTERN PyObject *_wrap_FloatVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6547  PyObject *resultobj = 0;
6548  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6549  std::vector< float > arg2 ;
6550  void *argp1 = 0 ;
6551  int res1 = 0 ;
6552  void *argp2 ;
6553  int res2 = 0 ;
6554  PyObject * obj0 = 0 ;
6555  PyObject * obj1 = 0 ;
6556 
6557  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_push_back",&obj0,&obj1)) SWIG_fail;
6558  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6559  if (!SWIG_IsOK(res1)) {
6560  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6561  }
6562  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6563  {
6564  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_float_t, 0 | 0);
6565  if (!SWIG_IsOK(res2)) {
6566  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'");
6567  }
6568  if (!argp2) {
6569  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_push_back" "', argument " "2"" of type '" "std::vector< float >""'");
6570  } else {
6571  std::vector< float > * temp = reinterpret_cast< std::vector< float > * >(argp2);
6572  arg2 = *temp;
6573  if (SWIG_IsNewObj(res2)) delete temp;
6574  }
6575  }
6576  (arg1)->push_back(arg2);
6577  resultobj = SWIG_Py_Void();
6578  return resultobj;
6579 fail:
6580  return NULL;
6581 }
6582 
6583 
6584 SWIGINTERN PyObject *_wrap_FloatVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6585  PyObject *resultobj = 0;
6586  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6587  void *argp1 = 0 ;
6588  int res1 = 0 ;
6589  PyObject * obj0 = 0 ;
6590 
6591  if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_clear",&obj0)) SWIG_fail;
6592  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6593  if (!SWIG_IsOK(res1)) {
6594  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6595  }
6596  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6597  (arg1)->clear();
6598  resultobj = SWIG_Py_Void();
6599  return resultobj;
6600 fail:
6601  return NULL;
6602 }
6603 
6604 
6605 SWIGINTERN PyObject *_wrap_FloatVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6606  PyObject *resultobj = 0;
6607  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6608  void *argp1 = 0 ;
6609  int res1 = 0 ;
6610  PyObject * obj0 = 0 ;
6611  std::vector< float > *result = 0 ;
6612 
6613  if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_data",&obj0)) SWIG_fail;
6614  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6615  if (!SWIG_IsOK(res1)) {
6616  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6617  }
6618  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6619  result = (std::vector< float > *)(arg1)->data();
6620  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
6621  return resultobj;
6622 fail:
6623  return NULL;
6624 }
6625 
6626 
6627 SWIGINTERN PyObject *_wrap_FloatVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6628  PyObject *resultobj = 0;
6629  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6630  void *argp1 = 0 ;
6631  int res1 = 0 ;
6632  PyObject * obj0 = 0 ;
6633  size_t result;
6634 
6635  if (!PyArg_ParseTuple(args,(char *)"O:FloatVectorVector_size",&obj0)) SWIG_fail;
6636  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6637  if (!SWIG_IsOK(res1)) {
6638  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6639  }
6640  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6641  result = (size_t)(arg1)->size();
6642  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6643  return resultobj;
6644 fail:
6645  return NULL;
6646 }
6647 
6648 
6649 SWIGINTERN PyObject *_wrap_FloatVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6650  PyObject *resultobj = 0;
6651  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6652  size_t arg2 ;
6653  void *argp1 = 0 ;
6654  int res1 = 0 ;
6655  size_t val2 ;
6656  int ecode2 = 0 ;
6657  PyObject * obj0 = 0 ;
6658  PyObject * obj1 = 0 ;
6659  std::vector< float > result;
6660 
6661  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_at",&obj0,&obj1)) SWIG_fail;
6662  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6663  if (!SWIG_IsOK(res1)) {
6664  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< float > > const *""'");
6665  }
6666  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6667  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6668  if (!SWIG_IsOK(ecode2)) {
6669  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_at" "', argument " "2"" of type '" "size_t""'");
6670  }
6671  arg2 = static_cast< size_t >(val2);
6672  result = ((std::vector< std::vector< float > > const *)arg1)->at(arg2);
6673  resultobj = SWIG_NewPointerObj((new std::vector< float >(static_cast< const std::vector< float >& >(result))), SWIGTYPE_p_std__vectorT_float_t, SWIG_POINTER_OWN | 0 );
6674  return resultobj;
6675 fail:
6676  return NULL;
6677 }
6678 
6679 
6680 SWIGINTERN PyObject *_wrap_FloatVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6681  PyObject *resultobj = 0;
6682  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6683  size_t arg2 ;
6684  void *argp1 = 0 ;
6685  int res1 = 0 ;
6686  size_t val2 ;
6687  int ecode2 = 0 ;
6688  PyObject * obj0 = 0 ;
6689  PyObject * obj1 = 0 ;
6690 
6691  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_resize",&obj0,&obj1)) SWIG_fail;
6692  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6693  if (!SWIG_IsOK(res1)) {
6694  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6695  }
6696  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6697  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6698  if (!SWIG_IsOK(ecode2)) {
6699  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FloatVectorVector_resize" "', argument " "2"" of type '" "size_t""'");
6700  }
6701  arg2 = static_cast< size_t >(val2);
6702  (arg1)->resize(arg2);
6703  resultobj = SWIG_Py_Void();
6704  return resultobj;
6705 fail:
6706  return NULL;
6707 }
6708 
6709 
6710 SWIGINTERN PyObject *_wrap_FloatVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6711  PyObject *resultobj = 0;
6712  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6713  std::vector< std::vector< float > > *arg2 = 0 ;
6714  void *argp1 = 0 ;
6715  int res1 = 0 ;
6716  void *argp2 = 0 ;
6717  int res2 = 0 ;
6718  PyObject * obj0 = 0 ;
6719  PyObject * obj1 = 0 ;
6720 
6721  if (!PyArg_ParseTuple(args,(char *)"OO:FloatVectorVector_swap",&obj0,&obj1)) SWIG_fail;
6722  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 | 0 );
6723  if (!SWIG_IsOK(res1)) {
6724  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FloatVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6725  }
6726  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6727  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, 0 );
6728  if (!SWIG_IsOK(res2)) {
6729  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'");
6730  }
6731  if (!argp2) {
6732  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FloatVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< float > > &""'");
6733  }
6734  arg2 = reinterpret_cast< std::vector< std::vector< float > > * >(argp2);
6735  (arg1)->swap(*arg2);
6736  resultobj = SWIG_Py_Void();
6737  return resultobj;
6738 fail:
6739  return NULL;
6740 }
6741 
6742 
6743 SWIGINTERN PyObject *_wrap_delete_FloatVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6744  PyObject *resultobj = 0;
6745  std::vector< std::vector< float > > *arg1 = (std::vector< std::vector< float > > *) 0 ;
6746  void *argp1 = 0 ;
6747  int res1 = 0 ;
6748  PyObject * obj0 = 0 ;
6749 
6750  if (!PyArg_ParseTuple(args,(char *)"O:delete_FloatVectorVector",&obj0)) SWIG_fail;
6751  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_POINTER_DISOWN | 0 );
6752  if (!SWIG_IsOK(res1)) {
6753  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FloatVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< float > > *""'");
6754  }
6755  arg1 = reinterpret_cast< std::vector< std::vector< float > > * >(argp1);
6756  delete arg1;
6757  resultobj = SWIG_Py_Void();
6758  return resultobj;
6759 fail:
6760  return NULL;
6761 }
6762 
6763 
6764 SWIGINTERN PyObject *FloatVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6765  PyObject *obj;
6766  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
6767  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_float_t_t, SWIG_NewClientData(obj));
6768  return SWIG_Py_Void();
6769 }
6770 
6771 SWIGINTERN PyObject *_wrap_new_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6772  PyObject *resultobj = 0;
6773  std::vector< std::vector< unsigned char > > *result = 0 ;
6774 
6775  if (!PyArg_ParseTuple(args,(char *)":new_ByteVectorVector")) SWIG_fail;
6776  result = (std::vector< std::vector< unsigned char > > *)new std::vector< std::vector< unsigned char > >();
6777  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_NEW | 0 );
6778  return resultobj;
6779 fail:
6780  return NULL;
6781 }
6782 
6783 
6784 SWIGINTERN PyObject *_wrap_ByteVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6785  PyObject *resultobj = 0;
6786  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6787  std::vector< unsigned char > arg2 ;
6788  void *argp1 = 0 ;
6789  int res1 = 0 ;
6790  void *argp2 ;
6791  int res2 = 0 ;
6792  PyObject * obj0 = 0 ;
6793  PyObject * obj1 = 0 ;
6794 
6795  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_push_back",&obj0,&obj1)) SWIG_fail;
6796  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6797  if (!SWIG_IsOK(res1)) {
6798  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6799  }
6800  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6801  {
6802  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0);
6803  if (!SWIG_IsOK(res2)) {
6804  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'");
6805  }
6806  if (!argp2) {
6807  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_push_back" "', argument " "2"" of type '" "std::vector< unsigned char >""'");
6808  } else {
6809  std::vector< unsigned char > * temp = reinterpret_cast< std::vector< unsigned char > * >(argp2);
6810  arg2 = *temp;
6811  if (SWIG_IsNewObj(res2)) delete temp;
6812  }
6813  }
6814  (arg1)->push_back(arg2);
6815  resultobj = SWIG_Py_Void();
6816  return resultobj;
6817 fail:
6818  return NULL;
6819 }
6820 
6821 
6822 SWIGINTERN PyObject *_wrap_ByteVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6823  PyObject *resultobj = 0;
6824  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6825  void *argp1 = 0 ;
6826  int res1 = 0 ;
6827  PyObject * obj0 = 0 ;
6828 
6829  if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_clear",&obj0)) SWIG_fail;
6830  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6831  if (!SWIG_IsOK(res1)) {
6832  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6833  }
6834  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6835  (arg1)->clear();
6836  resultobj = SWIG_Py_Void();
6837  return resultobj;
6838 fail:
6839  return NULL;
6840 }
6841 
6842 
6843 SWIGINTERN PyObject *_wrap_ByteVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6844  PyObject *resultobj = 0;
6845  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6846  void *argp1 = 0 ;
6847  int res1 = 0 ;
6848  PyObject * obj0 = 0 ;
6849  std::vector< unsigned char > *result = 0 ;
6850 
6851  if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_data",&obj0)) SWIG_fail;
6852  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6853  if (!SWIG_IsOK(res1)) {
6854  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6855  }
6856  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6857  result = (std::vector< unsigned char > *)(arg1)->data();
6858  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_unsigned_char_t, 0 | 0 );
6859  return resultobj;
6860 fail:
6861  return NULL;
6862 }
6863 
6864 
6865 SWIGINTERN PyObject *_wrap_ByteVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6866  PyObject *resultobj = 0;
6867  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6868  void *argp1 = 0 ;
6869  int res1 = 0 ;
6870  PyObject * obj0 = 0 ;
6871  size_t result;
6872 
6873  if (!PyArg_ParseTuple(args,(char *)"O:ByteVectorVector_size",&obj0)) SWIG_fail;
6874  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6875  if (!SWIG_IsOK(res1)) {
6876  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6877  }
6878  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6879  result = (size_t)(arg1)->size();
6880  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6881  return resultobj;
6882 fail:
6883  return NULL;
6884 }
6885 
6886 
6887 SWIGINTERN PyObject *_wrap_ByteVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6888  PyObject *resultobj = 0;
6889  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6890  size_t arg2 ;
6891  void *argp1 = 0 ;
6892  int res1 = 0 ;
6893  size_t val2 ;
6894  int ecode2 = 0 ;
6895  PyObject * obj0 = 0 ;
6896  PyObject * obj1 = 0 ;
6897  std::vector< unsigned char > result;
6898 
6899  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_at",&obj0,&obj1)) SWIG_fail;
6900  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6901  if (!SWIG_IsOK(res1)) {
6902  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > const *""'");
6903  }
6904  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6905  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6906  if (!SWIG_IsOK(ecode2)) {
6907  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_at" "', argument " "2"" of type '" "size_t""'");
6908  }
6909  arg2 = static_cast< size_t >(val2);
6910  result = ((std::vector< std::vector< unsigned char > > const *)arg1)->at(arg2);
6911  resultobj = SWIG_NewPointerObj((new std::vector< unsigned char >(static_cast< const std::vector< unsigned char >& >(result))), SWIGTYPE_p_std__vectorT_unsigned_char_t, SWIG_POINTER_OWN | 0 );
6912  return resultobj;
6913 fail:
6914  return NULL;
6915 }
6916 
6917 
6918 SWIGINTERN PyObject *_wrap_ByteVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6919  PyObject *resultobj = 0;
6920  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6921  size_t arg2 ;
6922  void *argp1 = 0 ;
6923  int res1 = 0 ;
6924  size_t val2 ;
6925  int ecode2 = 0 ;
6926  PyObject * obj0 = 0 ;
6927  PyObject * obj1 = 0 ;
6928 
6929  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_resize",&obj0,&obj1)) SWIG_fail;
6930  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6931  if (!SWIG_IsOK(res1)) {
6932  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6933  }
6934  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6935  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
6936  if (!SWIG_IsOK(ecode2)) {
6937  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteVectorVector_resize" "', argument " "2"" of type '" "size_t""'");
6938  }
6939  arg2 = static_cast< size_t >(val2);
6940  (arg1)->resize(arg2);
6941  resultobj = SWIG_Py_Void();
6942  return resultobj;
6943 fail:
6944  return NULL;
6945 }
6946 
6947 
6948 SWIGINTERN PyObject *_wrap_ByteVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6949  PyObject *resultobj = 0;
6950  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6951  std::vector< std::vector< unsigned char > > *arg2 = 0 ;
6952  void *argp1 = 0 ;
6953  int res1 = 0 ;
6954  void *argp2 = 0 ;
6955  int res2 = 0 ;
6956  PyObject * obj0 = 0 ;
6957  PyObject * obj1 = 0 ;
6958 
6959  if (!PyArg_ParseTuple(args,(char *)"OO:ByteVectorVector_swap",&obj0,&obj1)) SWIG_fail;
6960  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 | 0 );
6961  if (!SWIG_IsOK(res1)) {
6962  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6963  }
6964  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6965  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, 0 );
6966  if (!SWIG_IsOK(res2)) {
6967  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'");
6968  }
6969  if (!argp2) {
6970  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ByteVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< unsigned char > > &""'");
6971  }
6972  arg2 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp2);
6973  (arg1)->swap(*arg2);
6974  resultobj = SWIG_Py_Void();
6975  return resultobj;
6976 fail:
6977  return NULL;
6978 }
6979 
6980 
6981 SWIGINTERN PyObject *_wrap_delete_ByteVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6982  PyObject *resultobj = 0;
6983  std::vector< std::vector< unsigned char > > *arg1 = (std::vector< std::vector< unsigned char > > *) 0 ;
6984  void *argp1 = 0 ;
6985  int res1 = 0 ;
6986  PyObject * obj0 = 0 ;
6987 
6988  if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteVectorVector",&obj0)) SWIG_fail;
6989  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_POINTER_DISOWN | 0 );
6990  if (!SWIG_IsOK(res1)) {
6991  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< unsigned char > > *""'");
6992  }
6993  arg1 = reinterpret_cast< std::vector< std::vector< unsigned char > > * >(argp1);
6994  delete arg1;
6995  resultobj = SWIG_Py_Void();
6996  return resultobj;
6997 fail:
6998  return NULL;
6999 }
7000 
7001 
7002 SWIGINTERN PyObject *ByteVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7003  PyObject *obj;
7004  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
7005  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_uint8_t_t_t, SWIG_NewClientData(obj));
7006  return SWIG_Py_Void();
7007 }
7008 
7009 SWIGINTERN PyObject *_wrap_new_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7010  PyObject *resultobj = 0;
7011  std::vector< std::vector< long > > *result = 0 ;
7012 
7013  if (!PyArg_ParseTuple(args,(char *)":new_LongVectorVector")) SWIG_fail;
7014  result = (std::vector< std::vector< long > > *)new std::vector< std::vector< long > >();
7015  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_NEW | 0 );
7016  return resultobj;
7017 fail:
7018  return NULL;
7019 }
7020 
7021 
7022 SWIGINTERN PyObject *_wrap_LongVectorVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7023  PyObject *resultobj = 0;
7024  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7025  std::vector< long > arg2 ;
7026  void *argp1 = 0 ;
7027  int res1 = 0 ;
7028  void *argp2 ;
7029  int res2 = 0 ;
7030  PyObject * obj0 = 0 ;
7031  PyObject * obj1 = 0 ;
7032 
7033  if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_push_back",&obj0,&obj1)) SWIG_fail;
7034  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7035  if (!SWIG_IsOK(res1)) {
7036  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7037  }
7038  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7039  {
7040  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_long_t, 0 | 0);
7041  if (!SWIG_IsOK(res2)) {
7042  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'");
7043  }
7044  if (!argp2) {
7045  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_push_back" "', argument " "2"" of type '" "std::vector< long >""'");
7046  } else {
7047  std::vector< long > * temp = reinterpret_cast< std::vector< long > * >(argp2);
7048  arg2 = *temp;
7049  if (SWIG_IsNewObj(res2)) delete temp;
7050  }
7051  }
7052  (arg1)->push_back(arg2);
7053  resultobj = SWIG_Py_Void();
7054  return resultobj;
7055 fail:
7056  return NULL;
7057 }
7058 
7059 
7060 SWIGINTERN PyObject *_wrap_LongVectorVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7061  PyObject *resultobj = 0;
7062  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7063  void *argp1 = 0 ;
7064  int res1 = 0 ;
7065  PyObject * obj0 = 0 ;
7066 
7067  if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_clear",&obj0)) SWIG_fail;
7068  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7069  if (!SWIG_IsOK(res1)) {
7070  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7071  }
7072  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7073  (arg1)->clear();
7074  resultobj = SWIG_Py_Void();
7075  return resultobj;
7076 fail:
7077  return NULL;
7078 }
7079 
7080 
7081 SWIGINTERN PyObject *_wrap_LongVectorVector_data(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7082  PyObject *resultobj = 0;
7083  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7084  void *argp1 = 0 ;
7085  int res1 = 0 ;
7086  PyObject * obj0 = 0 ;
7087  std::vector< long > *result = 0 ;
7088 
7089  if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_data",&obj0)) SWIG_fail;
7090  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7091  if (!SWIG_IsOK(res1)) {
7092  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_data" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7093  }
7094  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7095  result = (std::vector< long > *)(arg1)->data();
7096  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_long_t, 0 | 0 );
7097  return resultobj;
7098 fail:
7099  return NULL;
7100 }
7101 
7102 
7103 SWIGINTERN PyObject *_wrap_LongVectorVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7104  PyObject *resultobj = 0;
7105  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7106  void *argp1 = 0 ;
7107  int res1 = 0 ;
7108  PyObject * obj0 = 0 ;
7109  size_t result;
7110 
7111  if (!PyArg_ParseTuple(args,(char *)"O:LongVectorVector_size",&obj0)) SWIG_fail;
7112  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7113  if (!SWIG_IsOK(res1)) {
7114  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_size" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7115  }
7116  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7117  result = (size_t)(arg1)->size();
7118  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
7119  return resultobj;
7120 fail:
7121  return NULL;
7122 }
7123 
7124 
7125 SWIGINTERN PyObject *_wrap_LongVectorVector_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7126  PyObject *resultobj = 0;
7127  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7128  size_t arg2 ;
7129  void *argp1 = 0 ;
7130  int res1 = 0 ;
7131  size_t val2 ;
7132  int ecode2 = 0 ;
7133  PyObject * obj0 = 0 ;
7134  PyObject * obj1 = 0 ;
7135  std::vector< long > result;
7136 
7137  if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_at",&obj0,&obj1)) SWIG_fail;
7138  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7139  if (!SWIG_IsOK(res1)) {
7140  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_at" "', argument " "1"" of type '" "std::vector< std::vector< long > > const *""'");
7141  }
7142  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7143  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7144  if (!SWIG_IsOK(ecode2)) {
7145  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_at" "', argument " "2"" of type '" "size_t""'");
7146  }
7147  arg2 = static_cast< size_t >(val2);
7148  result = ((std::vector< std::vector< long > > const *)arg1)->at(arg2);
7149  resultobj = SWIG_NewPointerObj((new std::vector< long >(static_cast< const std::vector< long >& >(result))), SWIGTYPE_p_std__vectorT_long_t, SWIG_POINTER_OWN | 0 );
7150  return resultobj;
7151 fail:
7152  return NULL;
7153 }
7154 
7155 
7156 SWIGINTERN PyObject *_wrap_LongVectorVector_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7157  PyObject *resultobj = 0;
7158  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7159  size_t arg2 ;
7160  void *argp1 = 0 ;
7161  int res1 = 0 ;
7162  size_t val2 ;
7163  int ecode2 = 0 ;
7164  PyObject * obj0 = 0 ;
7165  PyObject * obj1 = 0 ;
7166 
7167  if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_resize",&obj0,&obj1)) SWIG_fail;
7168  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7169  if (!SWIG_IsOK(res1)) {
7170  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7171  }
7172  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7173  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7174  if (!SWIG_IsOK(ecode2)) {
7175  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LongVectorVector_resize" "', argument " "2"" of type '" "size_t""'");
7176  }
7177  arg2 = static_cast< size_t >(val2);
7178  (arg1)->resize(arg2);
7179  resultobj = SWIG_Py_Void();
7180  return resultobj;
7181 fail:
7182  return NULL;
7183 }
7184 
7185 
7186 SWIGINTERN PyObject *_wrap_LongVectorVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7187  PyObject *resultobj = 0;
7188  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7189  std::vector< std::vector< long > > *arg2 = 0 ;
7190  void *argp1 = 0 ;
7191  int res1 = 0 ;
7192  void *argp2 = 0 ;
7193  int res2 = 0 ;
7194  PyObject * obj0 = 0 ;
7195  PyObject * obj1 = 0 ;
7196 
7197  if (!PyArg_ParseTuple(args,(char *)"OO:LongVectorVector_swap",&obj0,&obj1)) SWIG_fail;
7198  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 | 0 );
7199  if (!SWIG_IsOK(res1)) {
7200  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LongVectorVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7201  }
7202  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7203  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, 0 );
7204  if (!SWIG_IsOK(res2)) {
7205  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'");
7206  }
7207  if (!argp2) {
7208  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LongVectorVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< long > > &""'");
7209  }
7210  arg2 = reinterpret_cast< std::vector< std::vector< long > > * >(argp2);
7211  (arg1)->swap(*arg2);
7212  resultobj = SWIG_Py_Void();
7213  return resultobj;
7214 fail:
7215  return NULL;
7216 }
7217 
7218 
7219 SWIGINTERN PyObject *_wrap_delete_LongVectorVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7220  PyObject *resultobj = 0;
7221  std::vector< std::vector< long > > *arg1 = (std::vector< std::vector< long > > *) 0 ;
7222  void *argp1 = 0 ;
7223  int res1 = 0 ;
7224  PyObject * obj0 = 0 ;
7225 
7226  if (!PyArg_ParseTuple(args,(char *)"O:delete_LongVectorVector",&obj0)) SWIG_fail;
7227  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_POINTER_DISOWN | 0 );
7228  if (!SWIG_IsOK(res1)) {
7229  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LongVectorVector" "', argument " "1"" of type '" "std::vector< std::vector< long > > *""'");
7230  }
7231  arg1 = reinterpret_cast< std::vector< std::vector< long > > * >(argp1);
7232  delete arg1;
7233  resultobj = SWIG_Py_Void();
7234  return resultobj;
7235 fail:
7236  return NULL;
7237 }
7238 
7239 
7240 SWIGINTERN PyObject *LongVectorVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7241  PyObject *obj;
7242  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
7243  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_long_t_t, SWIG_NewClientData(obj));
7244  return SWIG_Py_Void();
7245 }
7246 
7247 SWIGINTERN int Swig_var_hamming_batch_size_set(PyObject *_val) {
7248  {
7249  size_t val;
7250  int res = SWIG_AsVal_size_t(_val, &val);
7251  if (!SWIG_IsOK(res)) {
7252  SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::hamming_batch_size""' of type '""size_t""'");
7253  }
7254  faiss::hamming_batch_size = static_cast< size_t >(val);
7255  }
7256  return 0;
7257 fail:
7258  return 1;
7259 }
7260 
7261 
7262 SWIGINTERN PyObject *Swig_var_hamming_batch_size_get(void) {
7263  PyObject *pyobj = 0;
7264 
7265  pyobj = SWIG_From_size_t(static_cast< size_t >(faiss::hamming_batch_size));
7266  return pyobj;
7267 }
7268 
7269 
7270 SWIGINTERN PyObject *_wrap_popcount64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7271  PyObject *resultobj = 0;
7272  uint64_t arg1 ;
7273  unsigned long val1 ;
7274  int ecode1 = 0 ;
7275  PyObject * obj0 = 0 ;
7276  int result;
7277 
7278  if (!PyArg_ParseTuple(args,(char *)"O:popcount64",&obj0)) SWIG_fail;
7279  ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1);
7280  if (!SWIG_IsOK(ecode1)) {
7281  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "popcount64" "', argument " "1"" of type '" "uint64_t""'");
7282  }
7283  arg1 = static_cast< uint64_t >(val1);
7284  {
7285  Py_BEGIN_ALLOW_THREADS
7286  try {
7287  result = (int)faiss::popcount64(arg1);
7288  } catch(faiss::FaissException & e) {
7289  PyEval_RestoreThread(_save);
7290 
7291  if (PyErr_Occurred()) {
7292  // some previous code already set the error type.
7293  } else {
7294  PyErr_SetString(PyExc_RuntimeError, e.what());
7295  }
7296  SWIG_fail;
7297  }
7298  Py_END_ALLOW_THREADS
7299  }
7300  resultobj = SWIG_From_int(static_cast< int >(result));
7301  return resultobj;
7302 fail:
7303  return NULL;
7304 }
7305 
7306 
7307 SWIGINTERN PyObject *_wrap_hammings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7308  PyObject *resultobj = 0;
7309  uint8_t *arg1 = (uint8_t *) 0 ;
7310  uint8_t *arg2 = (uint8_t *) 0 ;
7311  size_t arg3 ;
7312  size_t arg4 ;
7313  size_t arg5 ;
7314  hamdis_t *arg6 = (hamdis_t *) 0 ;
7315  void *argp1 = 0 ;
7316  int res1 = 0 ;
7317  void *argp2 = 0 ;
7318  int res2 = 0 ;
7319  size_t val3 ;
7320  int ecode3 = 0 ;
7321  size_t val4 ;
7322  int ecode4 = 0 ;
7323  size_t val5 ;
7324  int ecode5 = 0 ;
7325  void *argp6 = 0 ;
7326  int res6 = 0 ;
7327  PyObject * obj0 = 0 ;
7328  PyObject * obj1 = 0 ;
7329  PyObject * obj2 = 0 ;
7330  PyObject * obj3 = 0 ;
7331  PyObject * obj4 = 0 ;
7332  PyObject * obj5 = 0 ;
7333 
7334  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
7335  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
7336  if (!SWIG_IsOK(res1)) {
7337  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings" "', argument " "1"" of type '" "uint8_t const *""'");
7338  }
7339  arg1 = reinterpret_cast< uint8_t * >(argp1);
7340  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7341  if (!SWIG_IsOK(res2)) {
7342  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings" "', argument " "2"" of type '" "uint8_t const *""'");
7343  }
7344  arg2 = reinterpret_cast< uint8_t * >(argp2);
7345  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7346  if (!SWIG_IsOK(ecode3)) {
7347  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings" "', argument " "3"" of type '" "size_t""'");
7348  }
7349  arg3 = static_cast< size_t >(val3);
7350  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7351  if (!SWIG_IsOK(ecode4)) {
7352  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings" "', argument " "4"" of type '" "size_t""'");
7353  }
7354  arg4 = static_cast< size_t >(val4);
7355  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
7356  if (!SWIG_IsOK(ecode5)) {
7357  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings" "', argument " "5"" of type '" "size_t""'");
7358  }
7359  arg5 = static_cast< size_t >(val5);
7360  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 | 0 );
7361  if (!SWIG_IsOK(res6)) {
7362  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "hammings" "', argument " "6"" of type '" "hamdis_t *""'");
7363  }
7364  arg6 = reinterpret_cast< hamdis_t * >(argp6);
7365  {
7366  Py_BEGIN_ALLOW_THREADS
7367  try {
7368  faiss::hammings((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6);
7369  } catch(faiss::FaissException & e) {
7370  PyEval_RestoreThread(_save);
7371 
7372  if (PyErr_Occurred()) {
7373  // some previous code already set the error type.
7374  } else {
7375  PyErr_SetString(PyExc_RuntimeError, e.what());
7376  }
7377  SWIG_fail;
7378  }
7379  Py_END_ALLOW_THREADS
7380  }
7381  resultobj = SWIG_Py_Void();
7382  return resultobj;
7383 fail:
7384  return NULL;
7385 }
7386 
7387 
7388 SWIGINTERN PyObject *_wrap_bitvec_print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7389  PyObject *resultobj = 0;
7390  uint8_t *arg1 = (uint8_t *) 0 ;
7391  size_t arg2 ;
7392  void *argp1 = 0 ;
7393  int res1 = 0 ;
7394  size_t val2 ;
7395  int ecode2 = 0 ;
7396  PyObject * obj0 = 0 ;
7397  PyObject * obj1 = 0 ;
7398 
7399  if (!PyArg_ParseTuple(args,(char *)"OO:bitvec_print",&obj0,&obj1)) SWIG_fail;
7400  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
7401  if (!SWIG_IsOK(res1)) {
7402  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bitvec_print" "', argument " "1"" of type '" "uint8_t const *""'");
7403  }
7404  arg1 = reinterpret_cast< uint8_t * >(argp1);
7405  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
7406  if (!SWIG_IsOK(ecode2)) {
7407  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bitvec_print" "', argument " "2"" of type '" "size_t""'");
7408  }
7409  arg2 = static_cast< size_t >(val2);
7410  {
7411  Py_BEGIN_ALLOW_THREADS
7412  try {
7413  faiss::bitvec_print((unsigned char const *)arg1,arg2);
7414  } catch(faiss::FaissException & e) {
7415  PyEval_RestoreThread(_save);
7416 
7417  if (PyErr_Occurred()) {
7418  // some previous code already set the error type.
7419  } else {
7420  PyErr_SetString(PyExc_RuntimeError, e.what());
7421  }
7422  SWIG_fail;
7423  }
7424  Py_END_ALLOW_THREADS
7425  }
7426  resultobj = SWIG_Py_Void();
7427  return resultobj;
7428 fail:
7429  return NULL;
7430 }
7431 
7432 
7433 SWIGINTERN PyObject *_wrap_fvecs2bitvecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7434  PyObject *resultobj = 0;
7435  float *arg1 = (float *) 0 ;
7436  uint8_t *arg2 = (uint8_t *) 0 ;
7437  size_t arg3 ;
7438  size_t arg4 ;
7439  void *argp1 = 0 ;
7440  int res1 = 0 ;
7441  void *argp2 = 0 ;
7442  int res2 = 0 ;
7443  size_t val3 ;
7444  int ecode3 = 0 ;
7445  size_t val4 ;
7446  int ecode4 = 0 ;
7447  PyObject * obj0 = 0 ;
7448  PyObject * obj1 = 0 ;
7449  PyObject * obj2 = 0 ;
7450  PyObject * obj3 = 0 ;
7451 
7452  if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs2bitvecs",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
7453  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
7454  if (!SWIG_IsOK(res1)) {
7455  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvecs2bitvecs" "', argument " "1"" of type '" "float const *""'");
7456  }
7457  arg1 = reinterpret_cast< float * >(argp1);
7458  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7459  if (!SWIG_IsOK(res2)) {
7460  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs2bitvecs" "', argument " "2"" of type '" "uint8_t *""'");
7461  }
7462  arg2 = reinterpret_cast< uint8_t * >(argp2);
7463  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7464  if (!SWIG_IsOK(ecode3)) {
7465  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs2bitvecs" "', argument " "3"" of type '" "size_t""'");
7466  }
7467  arg3 = static_cast< size_t >(val3);
7468  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7469  if (!SWIG_IsOK(ecode4)) {
7470  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvecs2bitvecs" "', argument " "4"" of type '" "size_t""'");
7471  }
7472  arg4 = static_cast< size_t >(val4);
7473  {
7474  Py_BEGIN_ALLOW_THREADS
7475  try {
7476  faiss::fvecs2bitvecs((float const *)arg1,arg2,arg3,arg4);
7477  } catch(faiss::FaissException & e) {
7478  PyEval_RestoreThread(_save);
7479 
7480  if (PyErr_Occurred()) {
7481  // some previous code already set the error type.
7482  } else {
7483  PyErr_SetString(PyExc_RuntimeError, e.what());
7484  }
7485  SWIG_fail;
7486  }
7487  Py_END_ALLOW_THREADS
7488  }
7489  resultobj = SWIG_Py_Void();
7490  return resultobj;
7491 fail:
7492  return NULL;
7493 }
7494 
7495 
7496 SWIGINTERN PyObject *_wrap_fvec2bitvec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7497  PyObject *resultobj = 0;
7498  float *arg1 = (float *) 0 ;
7499  uint8_t *arg2 = (uint8_t *) 0 ;
7500  size_t arg3 ;
7501  void *argp1 = 0 ;
7502  int res1 = 0 ;
7503  void *argp2 = 0 ;
7504  int res2 = 0 ;
7505  size_t val3 ;
7506  int ecode3 = 0 ;
7507  PyObject * obj0 = 0 ;
7508  PyObject * obj1 = 0 ;
7509  PyObject * obj2 = 0 ;
7510 
7511  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec2bitvec",&obj0,&obj1,&obj2)) SWIG_fail;
7512  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
7513  if (!SWIG_IsOK(res1)) {
7514  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec2bitvec" "', argument " "1"" of type '" "float const *""'");
7515  }
7516  arg1 = reinterpret_cast< float * >(argp1);
7517  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7518  if (!SWIG_IsOK(res2)) {
7519  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec2bitvec" "', argument " "2"" of type '" "uint8_t *""'");
7520  }
7521  arg2 = reinterpret_cast< uint8_t * >(argp2);
7522  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7523  if (!SWIG_IsOK(ecode3)) {
7524  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec2bitvec" "', argument " "3"" of type '" "size_t""'");
7525  }
7526  arg3 = static_cast< size_t >(val3);
7527  {
7528  Py_BEGIN_ALLOW_THREADS
7529  try {
7530  faiss::fvec2bitvec((float const *)arg1,arg2,arg3);
7531  } catch(faiss::FaissException & e) {
7532  PyEval_RestoreThread(_save);
7533 
7534  if (PyErr_Occurred()) {
7535  // some previous code already set the error type.
7536  } else {
7537  PyErr_SetString(PyExc_RuntimeError, e.what());
7538  }
7539  SWIG_fail;
7540  }
7541  Py_END_ALLOW_THREADS
7542  }
7543  resultobj = SWIG_Py_Void();
7544  return resultobj;
7545 fail:
7546  return NULL;
7547 }
7548 
7549 
7550 SWIGINTERN PyObject *_wrap_hammings_knn_hc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7551  PyObject *resultobj = 0;
7553  uint8_t *arg2 = (uint8_t *) 0 ;
7554  uint8_t *arg3 = (uint8_t *) 0 ;
7555  size_t arg4 ;
7556  size_t arg5 ;
7557  int arg6 ;
7558  void *argp1 = 0 ;
7559  int res1 = 0 ;
7560  void *argp2 = 0 ;
7561  int res2 = 0 ;
7562  void *argp3 = 0 ;
7563  int res3 = 0 ;
7564  size_t val4 ;
7565  int ecode4 = 0 ;
7566  size_t val5 ;
7567  int ecode5 = 0 ;
7568  int val6 ;
7569  int ecode6 = 0 ;
7570  PyObject * obj0 = 0 ;
7571  PyObject * obj1 = 0 ;
7572  PyObject * obj2 = 0 ;
7573  PyObject * obj3 = 0 ;
7574  PyObject * obj4 = 0 ;
7575  PyObject * obj5 = 0 ;
7576 
7577  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
7578  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 );
7579  if (!SWIG_IsOK(res1)) {
7580  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'");
7581  }
7582  arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1);
7583  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7584  if (!SWIG_IsOK(res2)) {
7585  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'");
7586  }
7587  arg2 = reinterpret_cast< uint8_t * >(argp2);
7588  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
7589  if (!SWIG_IsOK(res3)) {
7590  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'");
7591  }
7592  arg3 = reinterpret_cast< uint8_t * >(argp3);
7593  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7594  if (!SWIG_IsOK(ecode4)) {
7595  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_hc" "', argument " "4"" of type '" "size_t""'");
7596  }
7597  arg4 = static_cast< size_t >(val4);
7598  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
7599  if (!SWIG_IsOK(ecode5)) {
7600  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_hc" "', argument " "5"" of type '" "size_t""'");
7601  }
7602  arg5 = static_cast< size_t >(val5);
7603  ecode6 = SWIG_AsVal_int(obj5, &val6);
7604  if (!SWIG_IsOK(ecode6)) {
7605  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_hc" "', argument " "6"" of type '" "int""'");
7606  }
7607  arg6 = static_cast< int >(val6);
7608  {
7609  Py_BEGIN_ALLOW_THREADS
7610  try {
7611  faiss::hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
7612  } catch(faiss::FaissException & e) {
7613  PyEval_RestoreThread(_save);
7614 
7615  if (PyErr_Occurred()) {
7616  // some previous code already set the error type.
7617  } else {
7618  PyErr_SetString(PyExc_RuntimeError, e.what());
7619  }
7620  SWIG_fail;
7621  }
7622  Py_END_ALLOW_THREADS
7623  }
7624  resultobj = SWIG_Py_Void();
7625  return resultobj;
7626 fail:
7627  return NULL;
7628 }
7629 
7630 
7631 SWIGINTERN PyObject *_wrap_hammings_knn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7632  PyObject *resultobj = 0;
7634  uint8_t *arg2 = (uint8_t *) 0 ;
7635  uint8_t *arg3 = (uint8_t *) 0 ;
7636  size_t arg4 ;
7637  size_t arg5 ;
7638  int arg6 ;
7639  void *argp1 = 0 ;
7640  int res1 = 0 ;
7641  void *argp2 = 0 ;
7642  int res2 = 0 ;
7643  void *argp3 = 0 ;
7644  int res3 = 0 ;
7645  size_t val4 ;
7646  int ecode4 = 0 ;
7647  size_t val5 ;
7648  int ecode5 = 0 ;
7649  int val6 ;
7650  int ecode6 = 0 ;
7651  PyObject * obj0 = 0 ;
7652  PyObject * obj1 = 0 ;
7653  PyObject * obj2 = 0 ;
7654  PyObject * obj3 = 0 ;
7655  PyObject * obj4 = 0 ;
7656  PyObject * obj5 = 0 ;
7657 
7658  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:hammings_knn",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
7659  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 );
7660  if (!SWIG_IsOK(res1)) {
7661  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'");
7662  }
7663  arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1);
7664  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7665  if (!SWIG_IsOK(res2)) {
7666  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn" "', argument " "2"" of type '" "uint8_t const *""'");
7667  }
7668  arg2 = reinterpret_cast< uint8_t * >(argp2);
7669  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
7670  if (!SWIG_IsOK(res3)) {
7671  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hammings_knn" "', argument " "3"" of type '" "uint8_t const *""'");
7672  }
7673  arg3 = reinterpret_cast< uint8_t * >(argp3);
7674  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7675  if (!SWIG_IsOK(ecode4)) {
7676  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn" "', argument " "4"" of type '" "size_t""'");
7677  }
7678  arg4 = static_cast< size_t >(val4);
7679  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
7680  if (!SWIG_IsOK(ecode5)) {
7681  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn" "', argument " "5"" of type '" "size_t""'");
7682  }
7683  arg5 = static_cast< size_t >(val5);
7684  ecode6 = SWIG_AsVal_int(obj5, &val6);
7685  if (!SWIG_IsOK(ecode6)) {
7686  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn" "', argument " "6"" of type '" "int""'");
7687  }
7688  arg6 = static_cast< int >(val6);
7689  {
7690  Py_BEGIN_ALLOW_THREADS
7691  try {
7692  faiss::hammings_knn(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
7693  } catch(faiss::FaissException & e) {
7694  PyEval_RestoreThread(_save);
7695 
7696  if (PyErr_Occurred()) {
7697  // some previous code already set the error type.
7698  } else {
7699  PyErr_SetString(PyExc_RuntimeError, e.what());
7700  }
7701  SWIG_fail;
7702  }
7703  Py_END_ALLOW_THREADS
7704  }
7705  resultobj = SWIG_Py_Void();
7706  return resultobj;
7707 fail:
7708  return NULL;
7709 }
7710 
7711 
7712 SWIGINTERN PyObject *_wrap_hammings_knn_mc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7713  PyObject *resultobj = 0;
7714  uint8_t *arg1 = (uint8_t *) 0 ;
7715  uint8_t *arg2 = (uint8_t *) 0 ;
7716  size_t arg3 ;
7717  size_t arg4 ;
7718  size_t arg5 ;
7719  size_t arg6 ;
7720  int32_t *arg7 = (int32_t *) 0 ;
7721  long *arg8 = (long *) 0 ;
7722  void *argp1 = 0 ;
7723  int res1 = 0 ;
7724  void *argp2 = 0 ;
7725  int res2 = 0 ;
7726  size_t val3 ;
7727  int ecode3 = 0 ;
7728  size_t val4 ;
7729  int ecode4 = 0 ;
7730  size_t val5 ;
7731  int ecode5 = 0 ;
7732  size_t val6 ;
7733  int ecode6 = 0 ;
7734  void *argp7 = 0 ;
7735  int res7 = 0 ;
7736  void *argp8 = 0 ;
7737  int res8 = 0 ;
7738  PyObject * obj0 = 0 ;
7739  PyObject * obj1 = 0 ;
7740  PyObject * obj2 = 0 ;
7741  PyObject * obj3 = 0 ;
7742  PyObject * obj4 = 0 ;
7743  PyObject * obj5 = 0 ;
7744  PyObject * obj6 = 0 ;
7745  PyObject * obj7 = 0 ;
7746 
7747  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:hammings_knn_mc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
7748  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
7749  if (!SWIG_IsOK(res1)) {
7750  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hammings_knn_mc" "', argument " "1"" of type '" "uint8_t const *""'");
7751  }
7752  arg1 = reinterpret_cast< uint8_t * >(argp1);
7753  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7754  if (!SWIG_IsOK(res2)) {
7755  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hammings_knn_mc" "', argument " "2"" of type '" "uint8_t const *""'");
7756  }
7757  arg2 = reinterpret_cast< uint8_t * >(argp2);
7758  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7759  if (!SWIG_IsOK(ecode3)) {
7760  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hammings_knn_mc" "', argument " "3"" of type '" "size_t""'");
7761  }
7762  arg3 = static_cast< size_t >(val3);
7763  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7764  if (!SWIG_IsOK(ecode4)) {
7765  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hammings_knn_mc" "', argument " "4"" of type '" "size_t""'");
7766  }
7767  arg4 = static_cast< size_t >(val4);
7768  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
7769  if (!SWIG_IsOK(ecode5)) {
7770  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hammings_knn_mc" "', argument " "5"" of type '" "size_t""'");
7771  }
7772  arg5 = static_cast< size_t >(val5);
7773  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
7774  if (!SWIG_IsOK(ecode6)) {
7775  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hammings_knn_mc" "', argument " "6"" of type '" "size_t""'");
7776  }
7777  arg6 = static_cast< size_t >(val6);
7778  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 | 0 );
7779  if (!SWIG_IsOK(res7)) {
7780  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hammings_knn_mc" "', argument " "7"" of type '" "int32_t *""'");
7781  }
7782  arg7 = reinterpret_cast< int32_t * >(argp7);
7783  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_long, 0 | 0 );
7784  if (!SWIG_IsOK(res8)) {
7785  SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "hammings_knn_mc" "', argument " "8"" of type '" "long *""'");
7786  }
7787  arg8 = reinterpret_cast< long * >(argp8);
7788  {
7789  Py_BEGIN_ALLOW_THREADS
7790  try {
7791  faiss::hammings_knn_mc((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
7792  } catch(faiss::FaissException & e) {
7793  PyEval_RestoreThread(_save);
7794 
7795  if (PyErr_Occurred()) {
7796  // some previous code already set the error type.
7797  } else {
7798  PyErr_SetString(PyExc_RuntimeError, e.what());
7799  }
7800  SWIG_fail;
7801  }
7802  Py_END_ALLOW_THREADS
7803  }
7804  resultobj = SWIG_Py_Void();
7805  return resultobj;
7806 fail:
7807  return NULL;
7808 }
7809 
7810 
7811 SWIGINTERN PyObject *_wrap_hamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7812  PyObject *resultobj = 0;
7813  uint8_t *arg1 = (uint8_t *) 0 ;
7814  uint8_t *arg2 = (uint8_t *) 0 ;
7815  size_t arg3 ;
7816  size_t arg4 ;
7817  hamdis_t arg5 ;
7818  size_t arg6 ;
7819  size_t *arg7 = (size_t *) 0 ;
7820  void *argp1 = 0 ;
7821  int res1 = 0 ;
7822  void *argp2 = 0 ;
7823  int res2 = 0 ;
7824  size_t val3 ;
7825  int ecode3 = 0 ;
7826  size_t val4 ;
7827  int ecode4 = 0 ;
7828  int val5 ;
7829  int ecode5 = 0 ;
7830  size_t val6 ;
7831  int ecode6 = 0 ;
7832  void *argp7 = 0 ;
7833  int res7 = 0 ;
7834  PyObject * obj0 = 0 ;
7835  PyObject * obj1 = 0 ;
7836  PyObject * obj2 = 0 ;
7837  PyObject * obj3 = 0 ;
7838  PyObject * obj4 = 0 ;
7839  PyObject * obj5 = 0 ;
7840  PyObject * obj6 = 0 ;
7841 
7842  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:hamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
7843  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
7844  if (!SWIG_IsOK(res1)) {
7845  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'");
7846  }
7847  arg1 = reinterpret_cast< uint8_t * >(argp1);
7848  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7849  if (!SWIG_IsOK(res2)) {
7850  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "hamming_count_thres" "', argument " "2"" of type '" "uint8_t const *""'");
7851  }
7852  arg2 = reinterpret_cast< uint8_t * >(argp2);
7853  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7854  if (!SWIG_IsOK(ecode3)) {
7855  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "hamming_count_thres" "', argument " "3"" of type '" "size_t""'");
7856  }
7857  arg3 = static_cast< size_t >(val3);
7858  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7859  if (!SWIG_IsOK(ecode4)) {
7860  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "hamming_count_thres" "', argument " "4"" of type '" "size_t""'");
7861  }
7862  arg4 = static_cast< size_t >(val4);
7863  ecode5 = SWIG_AsVal_int(obj4, &val5);
7864  if (!SWIG_IsOK(ecode5)) {
7865  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "hamming_count_thres" "', argument " "5"" of type '" "hamdis_t""'");
7866  }
7867  arg5 = static_cast< hamdis_t >(val5);
7868  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
7869  if (!SWIG_IsOK(ecode6)) {
7870  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "hamming_count_thres" "', argument " "6"" of type '" "size_t""'");
7871  }
7872  arg6 = static_cast< size_t >(val6);
7873  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_unsigned_long, 0 | 0 );
7874  if (!SWIG_IsOK(res7)) {
7875  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "hamming_count_thres" "', argument " "7"" of type '" "size_t *""'");
7876  }
7877  arg7 = reinterpret_cast< size_t * >(argp7);
7878  {
7879  Py_BEGIN_ALLOW_THREADS
7880  try {
7881  faiss::hamming_count_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7);
7882  } catch(faiss::FaissException & e) {
7883  PyEval_RestoreThread(_save);
7884 
7885  if (PyErr_Occurred()) {
7886  // some previous code already set the error type.
7887  } else {
7888  PyErr_SetString(PyExc_RuntimeError, e.what());
7889  }
7890  SWIG_fail;
7891  }
7892  Py_END_ALLOW_THREADS
7893  }
7894  resultobj = SWIG_Py_Void();
7895  return resultobj;
7896 fail:
7897  return NULL;
7898 }
7899 
7900 
7901 SWIGINTERN PyObject *_wrap_match_hamming_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7902  PyObject *resultobj = 0;
7903  uint8_t *arg1 = (uint8_t *) 0 ;
7904  uint8_t *arg2 = (uint8_t *) 0 ;
7905  size_t arg3 ;
7906  size_t arg4 ;
7907  hamdis_t arg5 ;
7908  size_t arg6 ;
7909  long *arg7 = (long *) 0 ;
7910  hamdis_t *arg8 = (hamdis_t *) 0 ;
7911  void *argp1 = 0 ;
7912  int res1 = 0 ;
7913  void *argp2 = 0 ;
7914  int res2 = 0 ;
7915  size_t val3 ;
7916  int ecode3 = 0 ;
7917  size_t val4 ;
7918  int ecode4 = 0 ;
7919  int val5 ;
7920  int ecode5 = 0 ;
7921  size_t val6 ;
7922  int ecode6 = 0 ;
7923  void *argp7 = 0 ;
7924  int res7 = 0 ;
7925  void *argp8 = 0 ;
7926  int res8 = 0 ;
7927  PyObject * obj0 = 0 ;
7928  PyObject * obj1 = 0 ;
7929  PyObject * obj2 = 0 ;
7930  PyObject * obj3 = 0 ;
7931  PyObject * obj4 = 0 ;
7932  PyObject * obj5 = 0 ;
7933  PyObject * obj6 = 0 ;
7934  PyObject * obj7 = 0 ;
7935  size_t result;
7936 
7937  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:match_hamming_thres",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
7938  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
7939  if (!SWIG_IsOK(res1)) {
7940  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "match_hamming_thres" "', argument " "1"" of type '" "uint8_t const *""'");
7941  }
7942  arg1 = reinterpret_cast< uint8_t * >(argp1);
7943  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
7944  if (!SWIG_IsOK(res2)) {
7945  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "match_hamming_thres" "', argument " "2"" of type '" "uint8_t const *""'");
7946  }
7947  arg2 = reinterpret_cast< uint8_t * >(argp2);
7948  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
7949  if (!SWIG_IsOK(ecode3)) {
7950  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "match_hamming_thres" "', argument " "3"" of type '" "size_t""'");
7951  }
7952  arg3 = static_cast< size_t >(val3);
7953  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
7954  if (!SWIG_IsOK(ecode4)) {
7955  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "match_hamming_thres" "', argument " "4"" of type '" "size_t""'");
7956  }
7957  arg4 = static_cast< size_t >(val4);
7958  ecode5 = SWIG_AsVal_int(obj4, &val5);
7959  if (!SWIG_IsOK(ecode5)) {
7960  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "match_hamming_thres" "', argument " "5"" of type '" "hamdis_t""'");
7961  }
7962  arg5 = static_cast< hamdis_t >(val5);
7963  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
7964  if (!SWIG_IsOK(ecode6)) {
7965  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "match_hamming_thres" "', argument " "6"" of type '" "size_t""'");
7966  }
7967  arg6 = static_cast< size_t >(val6);
7968  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_long, 0 | 0 );
7969  if (!SWIG_IsOK(res7)) {
7970  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "match_hamming_thres" "', argument " "7"" of type '" "long *""'");
7971  }
7972  arg7 = reinterpret_cast< long * >(argp7);
7973  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_int, 0 | 0 );
7974  if (!SWIG_IsOK(res8)) {
7975  SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "match_hamming_thres" "', argument " "8"" of type '" "hamdis_t *""'");
7976  }
7977  arg8 = reinterpret_cast< hamdis_t * >(argp8);
7978  {
7979  Py_BEGIN_ALLOW_THREADS
7980  try {
7981  result = (size_t)faiss::match_hamming_thres((unsigned char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
7982  } catch(faiss::FaissException & e) {
7983  PyEval_RestoreThread(_save);
7984 
7985  if (PyErr_Occurred()) {
7986  // some previous code already set the error type.
7987  } else {
7988  PyErr_SetString(PyExc_RuntimeError, e.what());
7989  }
7990  SWIG_fail;
7991  }
7992  Py_END_ALLOW_THREADS
7993  }
7994  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
7995  return resultobj;
7996 fail:
7997  return NULL;
7998 }
7999 
8000 
8001 SWIGINTERN PyObject *_wrap_crosshamming_count_thres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8002  PyObject *resultobj = 0;
8003  uint8_t *arg1 = (uint8_t *) 0 ;
8004  size_t arg2 ;
8005  hamdis_t arg3 ;
8006  size_t arg4 ;
8007  size_t *arg5 = (size_t *) 0 ;
8008  void *argp1 = 0 ;
8009  int res1 = 0 ;
8010  size_t val2 ;
8011  int ecode2 = 0 ;
8012  int val3 ;
8013  int ecode3 = 0 ;
8014  size_t val4 ;
8015  int ecode4 = 0 ;
8016  void *argp5 = 0 ;
8017  int res5 = 0 ;
8018  PyObject * obj0 = 0 ;
8019  PyObject * obj1 = 0 ;
8020  PyObject * obj2 = 0 ;
8021  PyObject * obj3 = 0 ;
8022  PyObject * obj4 = 0 ;
8023 
8024  if (!PyArg_ParseTuple(args,(char *)"OOOOO:crosshamming_count_thres",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
8025  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
8026  if (!SWIG_IsOK(res1)) {
8027  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "crosshamming_count_thres" "', argument " "1"" of type '" "uint8_t const *""'");
8028  }
8029  arg1 = reinterpret_cast< uint8_t * >(argp1);
8030  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
8031  if (!SWIG_IsOK(ecode2)) {
8032  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "crosshamming_count_thres" "', argument " "2"" of type '" "size_t""'");
8033  }
8034  arg2 = static_cast< size_t >(val2);
8035  ecode3 = SWIG_AsVal_int(obj2, &val3);
8036  if (!SWIG_IsOK(ecode3)) {
8037  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "crosshamming_count_thres" "', argument " "3"" of type '" "hamdis_t""'");
8038  }
8039  arg3 = static_cast< hamdis_t >(val3);
8040  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
8041  if (!SWIG_IsOK(ecode4)) {
8042  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "crosshamming_count_thres" "', argument " "4"" of type '" "size_t""'");
8043  }
8044  arg4 = static_cast< size_t >(val4);
8045  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_unsigned_long, 0 | 0 );
8046  if (!SWIG_IsOK(res5)) {
8047  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "crosshamming_count_thres" "', argument " "5"" of type '" "size_t *""'");
8048  }
8049  arg5 = reinterpret_cast< size_t * >(argp5);
8050  {
8051  Py_BEGIN_ALLOW_THREADS
8052  try {
8053  faiss::crosshamming_count_thres((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
8054  } catch(faiss::FaissException & e) {
8055  PyEval_RestoreThread(_save);
8056 
8057  if (PyErr_Occurred()) {
8058  // some previous code already set the error type.
8059  } else {
8060  PyErr_SetString(PyExc_RuntimeError, e.what());
8061  }
8062  SWIG_fail;
8063  }
8064  Py_END_ALLOW_THREADS
8065  }
8066  resultobj = SWIG_Py_Void();
8067  return resultobj;
8068 fail:
8069  return NULL;
8070 }
8071 
8072 
8073 SWIGINTERN PyObject *_wrap_HammingComputer4_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8074  PyObject *resultobj = 0;
8076  uint32_t arg2 ;
8077  void *argp1 = 0 ;
8078  int res1 = 0 ;
8079  void *argp2 ;
8080  int res2 = 0 ;
8081  PyObject * obj0 = 0 ;
8082  PyObject * obj1 = 0 ;
8083 
8084  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_a0_set",&obj0,&obj1)) SWIG_fail;
8085  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 );
8086  if (!SWIG_IsOK(res1)) {
8087  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'");
8088  }
8089  arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1);
8090  {
8091  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0);
8092  if (!SWIG_IsOK(res2)) {
8093  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'");
8094  }
8095  if (!argp2) {
8096  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer4_a0_set" "', argument " "2"" of type '" "uint32_t""'");
8097  } else {
8098  uint32_t * temp = reinterpret_cast< uint32_t * >(argp2);
8099  arg2 = *temp;
8100  if (SWIG_IsNewObj(res2)) delete temp;
8101  }
8102  }
8103  if (arg1) (arg1)->a0 = arg2;
8104  resultobj = SWIG_Py_Void();
8105  return resultobj;
8106 fail:
8107  return NULL;
8108 }
8109 
8110 
8111 SWIGINTERN PyObject *_wrap_HammingComputer4_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8112  PyObject *resultobj = 0;
8114  void *argp1 = 0 ;
8115  int res1 = 0 ;
8116  PyObject * obj0 = 0 ;
8117  uint32_t result;
8118 
8119  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer4_a0_get",&obj0)) SWIG_fail;
8120  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 );
8121  if (!SWIG_IsOK(res1)) {
8122  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'");
8123  }
8124  arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1);
8125  result = ((arg1)->a0);
8126  resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 );
8127  return resultobj;
8128 fail:
8129  return NULL;
8130 }
8131 
8132 
8133 SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8134  PyObject *resultobj = 0;
8135  faiss::HammingComputer4 *result = 0 ;
8136 
8137  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer4")) SWIG_fail;
8138  {
8139  Py_BEGIN_ALLOW_THREADS
8140  try {
8142  } catch(faiss::FaissException & e) {
8143  PyEval_RestoreThread(_save);
8144 
8145  if (PyErr_Occurred()) {
8146  // some previous code already set the error type.
8147  } else {
8148  PyErr_SetString(PyExc_RuntimeError, e.what());
8149  }
8150  SWIG_fail;
8151  }
8152  Py_END_ALLOW_THREADS
8153  }
8154  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 );
8155  return resultobj;
8156 fail:
8157  return NULL;
8158 }
8159 
8160 
8161 SWIGINTERN PyObject *_wrap_new_HammingComputer4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8162  PyObject *resultobj = 0;
8163  uint8_t *arg1 = (uint8_t *) 0 ;
8164  int arg2 ;
8165  void *argp1 = 0 ;
8166  int res1 = 0 ;
8167  int val2 ;
8168  int ecode2 = 0 ;
8169  PyObject * obj0 = 0 ;
8170  PyObject * obj1 = 0 ;
8171  faiss::HammingComputer4 *result = 0 ;
8172 
8173  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer4",&obj0,&obj1)) SWIG_fail;
8174  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
8175  if (!SWIG_IsOK(res1)) {
8176  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer4" "', argument " "1"" of type '" "uint8_t const *""'");
8177  }
8178  arg1 = reinterpret_cast< uint8_t * >(argp1);
8179  ecode2 = SWIG_AsVal_int(obj1, &val2);
8180  if (!SWIG_IsOK(ecode2)) {
8181  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer4" "', argument " "2"" of type '" "int""'");
8182  }
8183  arg2 = static_cast< int >(val2);
8184  {
8185  Py_BEGIN_ALLOW_THREADS
8186  try {
8187  result = (faiss::HammingComputer4 *)new faiss::HammingComputer4((uint8_t const *)arg1,arg2);
8188  } catch(faiss::FaissException & e) {
8189  PyEval_RestoreThread(_save);
8190 
8191  if (PyErr_Occurred()) {
8192  // some previous code already set the error type.
8193  } else {
8194  PyErr_SetString(PyExc_RuntimeError, e.what());
8195  }
8196  SWIG_fail;
8197  }
8198  Py_END_ALLOW_THREADS
8199  }
8200  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_NEW | 0 );
8201  return resultobj;
8202 fail:
8203  return NULL;
8204 }
8205 
8206 
8207 SWIGINTERN PyObject *_wrap_new_HammingComputer4(PyObject *self, PyObject *args) {
8208  Py_ssize_t argc;
8209  PyObject *argv[3] = {
8210  0
8211  };
8212  Py_ssize_t ii;
8213 
8214  if (!PyTuple_Check(args)) SWIG_fail;
8215  argc = args ? PyObject_Length(args) : 0;
8216  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
8217  argv[ii] = PyTuple_GET_ITEM(args,ii);
8218  }
8219  if (argc == 0) {
8220  return _wrap_new_HammingComputer4__SWIG_0(self, args);
8221  }
8222  if (argc == 2) {
8223  int _v;
8224  void *vptr = 0;
8225  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
8226  _v = SWIG_CheckState(res);
8227  if (_v) {
8228  {
8229  int res = SWIG_AsVal_int(argv[1], NULL);
8230  _v = SWIG_CheckState(res);
8231  }
8232  if (_v) {
8233  return _wrap_new_HammingComputer4__SWIG_1(self, args);
8234  }
8235  }
8236  }
8237 
8238 fail:
8239  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer4'.\n"
8240  " Possible C/C++ prototypes are:\n"
8241  " faiss::HammingComputer4::HammingComputer4()\n"
8242  " faiss::HammingComputer4::HammingComputer4(uint8_t const *,int)\n");
8243  return 0;
8244 }
8245 
8246 
8247 SWIGINTERN PyObject *_wrap_HammingComputer4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8248  PyObject *resultobj = 0;
8250  uint8_t *arg2 = (uint8_t *) 0 ;
8251  int arg3 ;
8252  void *argp1 = 0 ;
8253  int res1 = 0 ;
8254  void *argp2 = 0 ;
8255  int res2 = 0 ;
8256  int val3 ;
8257  int ecode3 = 0 ;
8258  PyObject * obj0 = 0 ;
8259  PyObject * obj1 = 0 ;
8260  PyObject * obj2 = 0 ;
8261 
8262  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer4_set",&obj0,&obj1,&obj2)) SWIG_fail;
8263  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 );
8264  if (!SWIG_IsOK(res1)) {
8265  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_set" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'");
8266  }
8267  arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1);
8268  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8269  if (!SWIG_IsOK(res2)) {
8270  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_set" "', argument " "2"" of type '" "uint8_t const *""'");
8271  }
8272  arg2 = reinterpret_cast< uint8_t * >(argp2);
8273  ecode3 = SWIG_AsVal_int(obj2, &val3);
8274  if (!SWIG_IsOK(ecode3)) {
8275  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer4_set" "', argument " "3"" of type '" "int""'");
8276  }
8277  arg3 = static_cast< int >(val3);
8278  {
8279  Py_BEGIN_ALLOW_THREADS
8280  try {
8281  (arg1)->set((uint8_t const *)arg2,arg3);
8282  } catch(faiss::FaissException & e) {
8283  PyEval_RestoreThread(_save);
8284 
8285  if (PyErr_Occurred()) {
8286  // some previous code already set the error type.
8287  } else {
8288  PyErr_SetString(PyExc_RuntimeError, e.what());
8289  }
8290  SWIG_fail;
8291  }
8292  Py_END_ALLOW_THREADS
8293  }
8294  resultobj = SWIG_Py_Void();
8295  return resultobj;
8296 fail:
8297  return NULL;
8298 }
8299 
8300 
8301 SWIGINTERN PyObject *_wrap_HammingComputer4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8302  PyObject *resultobj = 0;
8304  uint8_t *arg2 = (uint8_t *) 0 ;
8305  void *argp1 = 0 ;
8306  int res1 = 0 ;
8307  void *argp2 = 0 ;
8308  int res2 = 0 ;
8309  PyObject * obj0 = 0 ;
8310  PyObject * obj1 = 0 ;
8311  int result;
8312 
8313  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer4_hamming",&obj0,&obj1)) SWIG_fail;
8314  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, 0 | 0 );
8315  if (!SWIG_IsOK(res1)) {
8316  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer4_hamming" "', argument " "1"" of type '" "faiss::HammingComputer4 const *""'");
8317  }
8318  arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1);
8319  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8320  if (!SWIG_IsOK(res2)) {
8321  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer4_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
8322  }
8323  arg2 = reinterpret_cast< uint8_t * >(argp2);
8324  {
8325  Py_BEGIN_ALLOW_THREADS
8326  try {
8327  result = (int)((faiss::HammingComputer4 const *)arg1)->hamming((uint8_t const *)arg2);
8328  } catch(faiss::FaissException & e) {
8329  PyEval_RestoreThread(_save);
8330 
8331  if (PyErr_Occurred()) {
8332  // some previous code already set the error type.
8333  } else {
8334  PyErr_SetString(PyExc_RuntimeError, e.what());
8335  }
8336  SWIG_fail;
8337  }
8338  Py_END_ALLOW_THREADS
8339  }
8340  resultobj = SWIG_From_int(static_cast< int >(result));
8341  return resultobj;
8342 fail:
8343  return NULL;
8344 }
8345 
8346 
8347 SWIGINTERN PyObject *_wrap_delete_HammingComputer4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8348  PyObject *resultobj = 0;
8350  void *argp1 = 0 ;
8351  int res1 = 0 ;
8352  PyObject * obj0 = 0 ;
8353 
8354  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer4",&obj0)) SWIG_fail;
8355  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer4, SWIG_POINTER_DISOWN | 0 );
8356  if (!SWIG_IsOK(res1)) {
8357  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer4" "', argument " "1"" of type '" "faiss::HammingComputer4 *""'");
8358  }
8359  arg1 = reinterpret_cast< faiss::HammingComputer4 * >(argp1);
8360  delete arg1;
8361  resultobj = SWIG_Py_Void();
8362  return resultobj;
8363 fail:
8364  return NULL;
8365 }
8366 
8367 
8368 SWIGINTERN PyObject *HammingComputer4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8369  PyObject *obj;
8370  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
8371  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer4, SWIG_NewClientData(obj));
8372  return SWIG_Py_Void();
8373 }
8374 
8375 SWIGINTERN PyObject *_wrap_HammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8376  PyObject *resultobj = 0;
8378  uint64_t arg2 ;
8379  void *argp1 = 0 ;
8380  int res1 = 0 ;
8381  unsigned long val2 ;
8382  int ecode2 = 0 ;
8383  PyObject * obj0 = 0 ;
8384  PyObject * obj1 = 0 ;
8385 
8386  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail;
8387  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 );
8388  if (!SWIG_IsOK(res1)) {
8389  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'");
8390  }
8391  arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1);
8392  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
8393  if (!SWIG_IsOK(ecode2)) {
8394  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'");
8395  }
8396  arg2 = static_cast< uint64_t >(val2);
8397  if (arg1) (arg1)->a0 = arg2;
8398  resultobj = SWIG_Py_Void();
8399  return resultobj;
8400 fail:
8401  return NULL;
8402 }
8403 
8404 
8405 SWIGINTERN PyObject *_wrap_HammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8406  PyObject *resultobj = 0;
8408  void *argp1 = 0 ;
8409  int res1 = 0 ;
8410  PyObject * obj0 = 0 ;
8411  uint64_t result;
8412 
8413  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer8_a0_get",&obj0)) SWIG_fail;
8414  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 );
8415  if (!SWIG_IsOK(res1)) {
8416  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'");
8417  }
8418  arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1);
8419  result = (uint64_t) ((arg1)->a0);
8420  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
8421  return resultobj;
8422 fail:
8423  return NULL;
8424 }
8425 
8426 
8427 SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8428  PyObject *resultobj = 0;
8429  faiss::HammingComputer8 *result = 0 ;
8430 
8431  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer8")) SWIG_fail;
8432  {
8433  Py_BEGIN_ALLOW_THREADS
8434  try {
8436  } catch(faiss::FaissException & e) {
8437  PyEval_RestoreThread(_save);
8438 
8439  if (PyErr_Occurred()) {
8440  // some previous code already set the error type.
8441  } else {
8442  PyErr_SetString(PyExc_RuntimeError, e.what());
8443  }
8444  SWIG_fail;
8445  }
8446  Py_END_ALLOW_THREADS
8447  }
8448  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 );
8449  return resultobj;
8450 fail:
8451  return NULL;
8452 }
8453 
8454 
8455 SWIGINTERN PyObject *_wrap_new_HammingComputer8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8456  PyObject *resultobj = 0;
8457  uint8_t *arg1 = (uint8_t *) 0 ;
8458  int arg2 ;
8459  void *argp1 = 0 ;
8460  int res1 = 0 ;
8461  int val2 ;
8462  int ecode2 = 0 ;
8463  PyObject * obj0 = 0 ;
8464  PyObject * obj1 = 0 ;
8465  faiss::HammingComputer8 *result = 0 ;
8466 
8467  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer8",&obj0,&obj1)) SWIG_fail;
8468  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
8469  if (!SWIG_IsOK(res1)) {
8470  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'");
8471  }
8472  arg1 = reinterpret_cast< uint8_t * >(argp1);
8473  ecode2 = SWIG_AsVal_int(obj1, &val2);
8474  if (!SWIG_IsOK(ecode2)) {
8475  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer8" "', argument " "2"" of type '" "int""'");
8476  }
8477  arg2 = static_cast< int >(val2);
8478  {
8479  Py_BEGIN_ALLOW_THREADS
8480  try {
8481  result = (faiss::HammingComputer8 *)new faiss::HammingComputer8((uint8_t const *)arg1,arg2);
8482  } catch(faiss::FaissException & e) {
8483  PyEval_RestoreThread(_save);
8484 
8485  if (PyErr_Occurred()) {
8486  // some previous code already set the error type.
8487  } else {
8488  PyErr_SetString(PyExc_RuntimeError, e.what());
8489  }
8490  SWIG_fail;
8491  }
8492  Py_END_ALLOW_THREADS
8493  }
8494  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_NEW | 0 );
8495  return resultobj;
8496 fail:
8497  return NULL;
8498 }
8499 
8500 
8501 SWIGINTERN PyObject *_wrap_new_HammingComputer8(PyObject *self, PyObject *args) {
8502  Py_ssize_t argc;
8503  PyObject *argv[3] = {
8504  0
8505  };
8506  Py_ssize_t ii;
8507 
8508  if (!PyTuple_Check(args)) SWIG_fail;
8509  argc = args ? PyObject_Length(args) : 0;
8510  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
8511  argv[ii] = PyTuple_GET_ITEM(args,ii);
8512  }
8513  if (argc == 0) {
8514  return _wrap_new_HammingComputer8__SWIG_0(self, args);
8515  }
8516  if (argc == 2) {
8517  int _v;
8518  void *vptr = 0;
8519  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
8520  _v = SWIG_CheckState(res);
8521  if (_v) {
8522  {
8523  int res = SWIG_AsVal_int(argv[1], NULL);
8524  _v = SWIG_CheckState(res);
8525  }
8526  if (_v) {
8527  return _wrap_new_HammingComputer8__SWIG_1(self, args);
8528  }
8529  }
8530  }
8531 
8532 fail:
8533  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer8'.\n"
8534  " Possible C/C++ prototypes are:\n"
8535  " faiss::HammingComputer8::HammingComputer8()\n"
8536  " faiss::HammingComputer8::HammingComputer8(uint8_t const *,int)\n");
8537  return 0;
8538 }
8539 
8540 
8541 SWIGINTERN PyObject *_wrap_HammingComputer8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8542  PyObject *resultobj = 0;
8544  uint8_t *arg2 = (uint8_t *) 0 ;
8545  int arg3 ;
8546  void *argp1 = 0 ;
8547  int res1 = 0 ;
8548  void *argp2 = 0 ;
8549  int res2 = 0 ;
8550  int val3 ;
8551  int ecode3 = 0 ;
8552  PyObject * obj0 = 0 ;
8553  PyObject * obj1 = 0 ;
8554  PyObject * obj2 = 0 ;
8555 
8556  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer8_set",&obj0,&obj1,&obj2)) SWIG_fail;
8557  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 );
8558  if (!SWIG_IsOK(res1)) {
8559  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_set" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'");
8560  }
8561  arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1);
8562  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8563  if (!SWIG_IsOK(res2)) {
8564  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_set" "', argument " "2"" of type '" "uint8_t const *""'");
8565  }
8566  arg2 = reinterpret_cast< uint8_t * >(argp2);
8567  ecode3 = SWIG_AsVal_int(obj2, &val3);
8568  if (!SWIG_IsOK(ecode3)) {
8569  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer8_set" "', argument " "3"" of type '" "int""'");
8570  }
8571  arg3 = static_cast< int >(val3);
8572  {
8573  Py_BEGIN_ALLOW_THREADS
8574  try {
8575  (arg1)->set((uint8_t const *)arg2,arg3);
8576  } catch(faiss::FaissException & e) {
8577  PyEval_RestoreThread(_save);
8578 
8579  if (PyErr_Occurred()) {
8580  // some previous code already set the error type.
8581  } else {
8582  PyErr_SetString(PyExc_RuntimeError, e.what());
8583  }
8584  SWIG_fail;
8585  }
8586  Py_END_ALLOW_THREADS
8587  }
8588  resultobj = SWIG_Py_Void();
8589  return resultobj;
8590 fail:
8591  return NULL;
8592 }
8593 
8594 
8595 SWIGINTERN PyObject *_wrap_HammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8596  PyObject *resultobj = 0;
8598  uint8_t *arg2 = (uint8_t *) 0 ;
8599  void *argp1 = 0 ;
8600  int res1 = 0 ;
8601  void *argp2 = 0 ;
8602  int res2 = 0 ;
8603  PyObject * obj0 = 0 ;
8604  PyObject * obj1 = 0 ;
8605  int result;
8606 
8607  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer8_hamming",&obj0,&obj1)) SWIG_fail;
8608  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, 0 | 0 );
8609  if (!SWIG_IsOK(res1)) {
8610  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer8_hamming" "', argument " "1"" of type '" "faiss::HammingComputer8 const *""'");
8611  }
8612  arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1);
8613  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8614  if (!SWIG_IsOK(res2)) {
8615  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
8616  }
8617  arg2 = reinterpret_cast< uint8_t * >(argp2);
8618  {
8619  Py_BEGIN_ALLOW_THREADS
8620  try {
8621  result = (int)((faiss::HammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2);
8622  } catch(faiss::FaissException & e) {
8623  PyEval_RestoreThread(_save);
8624 
8625  if (PyErr_Occurred()) {
8626  // some previous code already set the error type.
8627  } else {
8628  PyErr_SetString(PyExc_RuntimeError, e.what());
8629  }
8630  SWIG_fail;
8631  }
8632  Py_END_ALLOW_THREADS
8633  }
8634  resultobj = SWIG_From_int(static_cast< int >(result));
8635  return resultobj;
8636 fail:
8637  return NULL;
8638 }
8639 
8640 
8641 SWIGINTERN PyObject *_wrap_delete_HammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8642  PyObject *resultobj = 0;
8644  void *argp1 = 0 ;
8645  int res1 = 0 ;
8646  PyObject * obj0 = 0 ;
8647 
8648  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer8",&obj0)) SWIG_fail;
8649  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer8, SWIG_POINTER_DISOWN | 0 );
8650  if (!SWIG_IsOK(res1)) {
8651  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer8" "', argument " "1"" of type '" "faiss::HammingComputer8 *""'");
8652  }
8653  arg1 = reinterpret_cast< faiss::HammingComputer8 * >(argp1);
8654  delete arg1;
8655  resultobj = SWIG_Py_Void();
8656  return resultobj;
8657 fail:
8658  return NULL;
8659 }
8660 
8661 
8662 SWIGINTERN PyObject *HammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8663  PyObject *obj;
8664  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
8665  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer8, SWIG_NewClientData(obj));
8666  return SWIG_Py_Void();
8667 }
8668 
8669 SWIGINTERN PyObject *_wrap_HammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8670  PyObject *resultobj = 0;
8672  uint64_t arg2 ;
8673  void *argp1 = 0 ;
8674  int res1 = 0 ;
8675  unsigned long val2 ;
8676  int ecode2 = 0 ;
8677  PyObject * obj0 = 0 ;
8678  PyObject * obj1 = 0 ;
8679 
8680  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail;
8681  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8682  if (!SWIG_IsOK(res1)) {
8683  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8684  }
8685  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8686  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
8687  if (!SWIG_IsOK(ecode2)) {
8688  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'");
8689  }
8690  arg2 = static_cast< uint64_t >(val2);
8691  if (arg1) (arg1)->a0 = arg2;
8692  resultobj = SWIG_Py_Void();
8693  return resultobj;
8694 fail:
8695  return NULL;
8696 }
8697 
8698 
8699 SWIGINTERN PyObject *_wrap_HammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8700  PyObject *resultobj = 0;
8702  void *argp1 = 0 ;
8703  int res1 = 0 ;
8704  PyObject * obj0 = 0 ;
8705  uint64_t result;
8706 
8707  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a0_get",&obj0)) SWIG_fail;
8708  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8709  if (!SWIG_IsOK(res1)) {
8710  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8711  }
8712  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8713  result = (uint64_t) ((arg1)->a0);
8714  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
8715  return resultobj;
8716 fail:
8717  return NULL;
8718 }
8719 
8720 
8721 SWIGINTERN PyObject *_wrap_HammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8722  PyObject *resultobj = 0;
8724  uint64_t arg2 ;
8725  void *argp1 = 0 ;
8726  int res1 = 0 ;
8727  unsigned long val2 ;
8728  int ecode2 = 0 ;
8729  PyObject * obj0 = 0 ;
8730  PyObject * obj1 = 0 ;
8731 
8732  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail;
8733  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8734  if (!SWIG_IsOK(res1)) {
8735  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8736  }
8737  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8738  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
8739  if (!SWIG_IsOK(ecode2)) {
8740  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'");
8741  }
8742  arg2 = static_cast< uint64_t >(val2);
8743  if (arg1) (arg1)->a1 = arg2;
8744  resultobj = SWIG_Py_Void();
8745  return resultobj;
8746 fail:
8747  return NULL;
8748 }
8749 
8750 
8751 SWIGINTERN PyObject *_wrap_HammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8752  PyObject *resultobj = 0;
8754  void *argp1 = 0 ;
8755  int res1 = 0 ;
8756  PyObject * obj0 = 0 ;
8757  uint64_t result;
8758 
8759  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer16_a1_get",&obj0)) SWIG_fail;
8760  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8761  if (!SWIG_IsOK(res1)) {
8762  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8763  }
8764  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8765  result = (uint64_t) ((arg1)->a1);
8766  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
8767  return resultobj;
8768 fail:
8769  return NULL;
8770 }
8771 
8772 
8773 SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8774  PyObject *resultobj = 0;
8775  faiss::HammingComputer16 *result = 0 ;
8776 
8777  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer16")) SWIG_fail;
8778  {
8779  Py_BEGIN_ALLOW_THREADS
8780  try {
8782  } catch(faiss::FaissException & e) {
8783  PyEval_RestoreThread(_save);
8784 
8785  if (PyErr_Occurred()) {
8786  // some previous code already set the error type.
8787  } else {
8788  PyErr_SetString(PyExc_RuntimeError, e.what());
8789  }
8790  SWIG_fail;
8791  }
8792  Py_END_ALLOW_THREADS
8793  }
8794  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 );
8795  return resultobj;
8796 fail:
8797  return NULL;
8798 }
8799 
8800 
8801 SWIGINTERN PyObject *_wrap_new_HammingComputer16__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8802  PyObject *resultobj = 0;
8803  uint8_t *arg1 = (uint8_t *) 0 ;
8804  int arg2 ;
8805  void *argp1 = 0 ;
8806  int res1 = 0 ;
8807  int val2 ;
8808  int ecode2 = 0 ;
8809  PyObject * obj0 = 0 ;
8810  PyObject * obj1 = 0 ;
8811  faiss::HammingComputer16 *result = 0 ;
8812 
8813  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer16",&obj0,&obj1)) SWIG_fail;
8814  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
8815  if (!SWIG_IsOK(res1)) {
8816  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'");
8817  }
8818  arg1 = reinterpret_cast< uint8_t * >(argp1);
8819  ecode2 = SWIG_AsVal_int(obj1, &val2);
8820  if (!SWIG_IsOK(ecode2)) {
8821  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer16" "', argument " "2"" of type '" "int""'");
8822  }
8823  arg2 = static_cast< int >(val2);
8824  {
8825  Py_BEGIN_ALLOW_THREADS
8826  try {
8827  result = (faiss::HammingComputer16 *)new faiss::HammingComputer16((uint8_t const *)arg1,arg2);
8828  } catch(faiss::FaissException & e) {
8829  PyEval_RestoreThread(_save);
8830 
8831  if (PyErr_Occurred()) {
8832  // some previous code already set the error type.
8833  } else {
8834  PyErr_SetString(PyExc_RuntimeError, e.what());
8835  }
8836  SWIG_fail;
8837  }
8838  Py_END_ALLOW_THREADS
8839  }
8840  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_NEW | 0 );
8841  return resultobj;
8842 fail:
8843  return NULL;
8844 }
8845 
8846 
8847 SWIGINTERN PyObject *_wrap_new_HammingComputer16(PyObject *self, PyObject *args) {
8848  Py_ssize_t argc;
8849  PyObject *argv[3] = {
8850  0
8851  };
8852  Py_ssize_t ii;
8853 
8854  if (!PyTuple_Check(args)) SWIG_fail;
8855  argc = args ? PyObject_Length(args) : 0;
8856  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
8857  argv[ii] = PyTuple_GET_ITEM(args,ii);
8858  }
8859  if (argc == 0) {
8860  return _wrap_new_HammingComputer16__SWIG_0(self, args);
8861  }
8862  if (argc == 2) {
8863  int _v;
8864  void *vptr = 0;
8865  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
8866  _v = SWIG_CheckState(res);
8867  if (_v) {
8868  {
8869  int res = SWIG_AsVal_int(argv[1], NULL);
8870  _v = SWIG_CheckState(res);
8871  }
8872  if (_v) {
8873  return _wrap_new_HammingComputer16__SWIG_1(self, args);
8874  }
8875  }
8876  }
8877 
8878 fail:
8879  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer16'.\n"
8880  " Possible C/C++ prototypes are:\n"
8881  " faiss::HammingComputer16::HammingComputer16()\n"
8882  " faiss::HammingComputer16::HammingComputer16(uint8_t const *,int)\n");
8883  return 0;
8884 }
8885 
8886 
8887 SWIGINTERN PyObject *_wrap_HammingComputer16_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8888  PyObject *resultobj = 0;
8890  uint8_t *arg2 = (uint8_t *) 0 ;
8891  int arg3 ;
8892  void *argp1 = 0 ;
8893  int res1 = 0 ;
8894  void *argp2 = 0 ;
8895  int res2 = 0 ;
8896  int val3 ;
8897  int ecode3 = 0 ;
8898  PyObject * obj0 = 0 ;
8899  PyObject * obj1 = 0 ;
8900  PyObject * obj2 = 0 ;
8901 
8902  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer16_set",&obj0,&obj1,&obj2)) SWIG_fail;
8903  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8904  if (!SWIG_IsOK(res1)) {
8905  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_set" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8906  }
8907  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8908  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8909  if (!SWIG_IsOK(res2)) {
8910  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_set" "', argument " "2"" of type '" "uint8_t const *""'");
8911  }
8912  arg2 = reinterpret_cast< uint8_t * >(argp2);
8913  ecode3 = SWIG_AsVal_int(obj2, &val3);
8914  if (!SWIG_IsOK(ecode3)) {
8915  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer16_set" "', argument " "3"" of type '" "int""'");
8916  }
8917  arg3 = static_cast< int >(val3);
8918  {
8919  Py_BEGIN_ALLOW_THREADS
8920  try {
8921  (arg1)->set((uint8_t const *)arg2,arg3);
8922  } catch(faiss::FaissException & e) {
8923  PyEval_RestoreThread(_save);
8924 
8925  if (PyErr_Occurred()) {
8926  // some previous code already set the error type.
8927  } else {
8928  PyErr_SetString(PyExc_RuntimeError, e.what());
8929  }
8930  SWIG_fail;
8931  }
8932  Py_END_ALLOW_THREADS
8933  }
8934  resultobj = SWIG_Py_Void();
8935  return resultobj;
8936 fail:
8937  return NULL;
8938 }
8939 
8940 
8941 SWIGINTERN PyObject *_wrap_HammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8942  PyObject *resultobj = 0;
8944  uint8_t *arg2 = (uint8_t *) 0 ;
8945  void *argp1 = 0 ;
8946  int res1 = 0 ;
8947  void *argp2 = 0 ;
8948  int res2 = 0 ;
8949  PyObject * obj0 = 0 ;
8950  PyObject * obj1 = 0 ;
8951  int result;
8952 
8953  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer16_hamming",&obj0,&obj1)) SWIG_fail;
8954  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, 0 | 0 );
8955  if (!SWIG_IsOK(res1)) {
8956  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer16_hamming" "', argument " "1"" of type '" "faiss::HammingComputer16 const *""'");
8957  }
8958  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
8959  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
8960  if (!SWIG_IsOK(res2)) {
8961  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
8962  }
8963  arg2 = reinterpret_cast< uint8_t * >(argp2);
8964  {
8965  Py_BEGIN_ALLOW_THREADS
8966  try {
8967  result = (int)((faiss::HammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2);
8968  } catch(faiss::FaissException & e) {
8969  PyEval_RestoreThread(_save);
8970 
8971  if (PyErr_Occurred()) {
8972  // some previous code already set the error type.
8973  } else {
8974  PyErr_SetString(PyExc_RuntimeError, e.what());
8975  }
8976  SWIG_fail;
8977  }
8978  Py_END_ALLOW_THREADS
8979  }
8980  resultobj = SWIG_From_int(static_cast< int >(result));
8981  return resultobj;
8982 fail:
8983  return NULL;
8984 }
8985 
8986 
8987 SWIGINTERN PyObject *_wrap_delete_HammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8988  PyObject *resultobj = 0;
8990  void *argp1 = 0 ;
8991  int res1 = 0 ;
8992  PyObject * obj0 = 0 ;
8993 
8994  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer16",&obj0)) SWIG_fail;
8995  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer16, SWIG_POINTER_DISOWN | 0 );
8996  if (!SWIG_IsOK(res1)) {
8997  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer16" "', argument " "1"" of type '" "faiss::HammingComputer16 *""'");
8998  }
8999  arg1 = reinterpret_cast< faiss::HammingComputer16 * >(argp1);
9000  delete arg1;
9001  resultobj = SWIG_Py_Void();
9002  return resultobj;
9003 fail:
9004  return NULL;
9005 }
9006 
9007 
9008 SWIGINTERN PyObject *HammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9009  PyObject *obj;
9010  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
9011  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer16, SWIG_NewClientData(obj));
9012  return SWIG_Py_Void();
9013 }
9014 
9015 SWIGINTERN PyObject *_wrap_HammingComputer20_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9016  PyObject *resultobj = 0;
9018  uint64_t arg2 ;
9019  void *argp1 = 0 ;
9020  int res1 = 0 ;
9021  unsigned long val2 ;
9022  int ecode2 = 0 ;
9023  PyObject * obj0 = 0 ;
9024  PyObject * obj1 = 0 ;
9025 
9026  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a0_set",&obj0,&obj1)) SWIG_fail;
9027  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9028  if (!SWIG_IsOK(res1)) {
9029  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9030  }
9031  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9032  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9033  if (!SWIG_IsOK(ecode2)) {
9034  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a0_set" "', argument " "2"" of type '" "uint64_t""'");
9035  }
9036  arg2 = static_cast< uint64_t >(val2);
9037  if (arg1) (arg1)->a0 = arg2;
9038  resultobj = SWIG_Py_Void();
9039  return resultobj;
9040 fail:
9041  return NULL;
9042 }
9043 
9044 
9045 SWIGINTERN PyObject *_wrap_HammingComputer20_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9046  PyObject *resultobj = 0;
9048  void *argp1 = 0 ;
9049  int res1 = 0 ;
9050  PyObject * obj0 = 0 ;
9051  uint64_t result;
9052 
9053  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a0_get",&obj0)) SWIG_fail;
9054  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9055  if (!SWIG_IsOK(res1)) {
9056  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9057  }
9058  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9059  result = (uint64_t) ((arg1)->a0);
9060  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9061  return resultobj;
9062 fail:
9063  return NULL;
9064 }
9065 
9066 
9067 SWIGINTERN PyObject *_wrap_HammingComputer20_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9068  PyObject *resultobj = 0;
9070  uint64_t arg2 ;
9071  void *argp1 = 0 ;
9072  int res1 = 0 ;
9073  unsigned long val2 ;
9074  int ecode2 = 0 ;
9075  PyObject * obj0 = 0 ;
9076  PyObject * obj1 = 0 ;
9077 
9078  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a1_set",&obj0,&obj1)) SWIG_fail;
9079  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9080  if (!SWIG_IsOK(res1)) {
9081  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9082  }
9083  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9084  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9085  if (!SWIG_IsOK(ecode2)) {
9086  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer20_a1_set" "', argument " "2"" of type '" "uint64_t""'");
9087  }
9088  arg2 = static_cast< uint64_t >(val2);
9089  if (arg1) (arg1)->a1 = arg2;
9090  resultobj = SWIG_Py_Void();
9091  return resultobj;
9092 fail:
9093  return NULL;
9094 }
9095 
9096 
9097 SWIGINTERN PyObject *_wrap_HammingComputer20_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9098  PyObject *resultobj = 0;
9100  void *argp1 = 0 ;
9101  int res1 = 0 ;
9102  PyObject * obj0 = 0 ;
9103  uint64_t result;
9104 
9105  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a1_get",&obj0)) SWIG_fail;
9106  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9107  if (!SWIG_IsOK(res1)) {
9108  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9109  }
9110  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9111  result = (uint64_t) ((arg1)->a1);
9112  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9113  return resultobj;
9114 fail:
9115  return NULL;
9116 }
9117 
9118 
9119 SWIGINTERN PyObject *_wrap_HammingComputer20_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9120  PyObject *resultobj = 0;
9122  uint32_t arg2 ;
9123  void *argp1 = 0 ;
9124  int res1 = 0 ;
9125  void *argp2 ;
9126  int res2 = 0 ;
9127  PyObject * obj0 = 0 ;
9128  PyObject * obj1 = 0 ;
9129 
9130  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_a2_set",&obj0,&obj1)) SWIG_fail;
9131  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9132  if (!SWIG_IsOK(res1)) {
9133  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9134  }
9135  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9136  {
9137  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0);
9138  if (!SWIG_IsOK(res2)) {
9139  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'");
9140  }
9141  if (!argp2) {
9142  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HammingComputer20_a2_set" "', argument " "2"" of type '" "uint32_t""'");
9143  } else {
9144  uint32_t * temp = reinterpret_cast< uint32_t * >(argp2);
9145  arg2 = *temp;
9146  if (SWIG_IsNewObj(res2)) delete temp;
9147  }
9148  }
9149  if (arg1) (arg1)->a2 = arg2;
9150  resultobj = SWIG_Py_Void();
9151  return resultobj;
9152 fail:
9153  return NULL;
9154 }
9155 
9156 
9157 SWIGINTERN PyObject *_wrap_HammingComputer20_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9158  PyObject *resultobj = 0;
9160  void *argp1 = 0 ;
9161  int res1 = 0 ;
9162  PyObject * obj0 = 0 ;
9163  uint32_t result;
9164 
9165  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer20_a2_get",&obj0)) SWIG_fail;
9166  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9167  if (!SWIG_IsOK(res1)) {
9168  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9169  }
9170  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9171  result = ((arg1)->a2);
9172  resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 );
9173  return resultobj;
9174 fail:
9175  return NULL;
9176 }
9177 
9178 
9179 SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9180  PyObject *resultobj = 0;
9181  faiss::HammingComputer20 *result = 0 ;
9182 
9183  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer20")) SWIG_fail;
9184  {
9185  Py_BEGIN_ALLOW_THREADS
9186  try {
9188  } catch(faiss::FaissException & e) {
9189  PyEval_RestoreThread(_save);
9190 
9191  if (PyErr_Occurred()) {
9192  // some previous code already set the error type.
9193  } else {
9194  PyErr_SetString(PyExc_RuntimeError, e.what());
9195  }
9196  SWIG_fail;
9197  }
9198  Py_END_ALLOW_THREADS
9199  }
9200  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 );
9201  return resultobj;
9202 fail:
9203  return NULL;
9204 }
9205 
9206 
9207 SWIGINTERN PyObject *_wrap_new_HammingComputer20__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9208  PyObject *resultobj = 0;
9209  uint8_t *arg1 = (uint8_t *) 0 ;
9210  int arg2 ;
9211  void *argp1 = 0 ;
9212  int res1 = 0 ;
9213  int val2 ;
9214  int ecode2 = 0 ;
9215  PyObject * obj0 = 0 ;
9216  PyObject * obj1 = 0 ;
9217  faiss::HammingComputer20 *result = 0 ;
9218 
9219  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer20",&obj0,&obj1)) SWIG_fail;
9220  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
9221  if (!SWIG_IsOK(res1)) {
9222  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer20" "', argument " "1"" of type '" "uint8_t const *""'");
9223  }
9224  arg1 = reinterpret_cast< uint8_t * >(argp1);
9225  ecode2 = SWIG_AsVal_int(obj1, &val2);
9226  if (!SWIG_IsOK(ecode2)) {
9227  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer20" "', argument " "2"" of type '" "int""'");
9228  }
9229  arg2 = static_cast< int >(val2);
9230  {
9231  Py_BEGIN_ALLOW_THREADS
9232  try {
9233  result = (faiss::HammingComputer20 *)new faiss::HammingComputer20((uint8_t const *)arg1,arg2);
9234  } catch(faiss::FaissException & e) {
9235  PyEval_RestoreThread(_save);
9236 
9237  if (PyErr_Occurred()) {
9238  // some previous code already set the error type.
9239  } else {
9240  PyErr_SetString(PyExc_RuntimeError, e.what());
9241  }
9242  SWIG_fail;
9243  }
9244  Py_END_ALLOW_THREADS
9245  }
9246  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_NEW | 0 );
9247  return resultobj;
9248 fail:
9249  return NULL;
9250 }
9251 
9252 
9253 SWIGINTERN PyObject *_wrap_new_HammingComputer20(PyObject *self, PyObject *args) {
9254  Py_ssize_t argc;
9255  PyObject *argv[3] = {
9256  0
9257  };
9258  Py_ssize_t ii;
9259 
9260  if (!PyTuple_Check(args)) SWIG_fail;
9261  argc = args ? PyObject_Length(args) : 0;
9262  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
9263  argv[ii] = PyTuple_GET_ITEM(args,ii);
9264  }
9265  if (argc == 0) {
9266  return _wrap_new_HammingComputer20__SWIG_0(self, args);
9267  }
9268  if (argc == 2) {
9269  int _v;
9270  void *vptr = 0;
9271  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
9272  _v = SWIG_CheckState(res);
9273  if (_v) {
9274  {
9275  int res = SWIG_AsVal_int(argv[1], NULL);
9276  _v = SWIG_CheckState(res);
9277  }
9278  if (_v) {
9279  return _wrap_new_HammingComputer20__SWIG_1(self, args);
9280  }
9281  }
9282  }
9283 
9284 fail:
9285  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer20'.\n"
9286  " Possible C/C++ prototypes are:\n"
9287  " faiss::HammingComputer20::HammingComputer20()\n"
9288  " faiss::HammingComputer20::HammingComputer20(uint8_t const *,int)\n");
9289  return 0;
9290 }
9291 
9292 
9293 SWIGINTERN PyObject *_wrap_HammingComputer20_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9294  PyObject *resultobj = 0;
9296  uint8_t *arg2 = (uint8_t *) 0 ;
9297  int arg3 ;
9298  void *argp1 = 0 ;
9299  int res1 = 0 ;
9300  void *argp2 = 0 ;
9301  int res2 = 0 ;
9302  int val3 ;
9303  int ecode3 = 0 ;
9304  PyObject * obj0 = 0 ;
9305  PyObject * obj1 = 0 ;
9306  PyObject * obj2 = 0 ;
9307 
9308  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer20_set",&obj0,&obj1,&obj2)) SWIG_fail;
9309  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9310  if (!SWIG_IsOK(res1)) {
9311  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_set" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9312  }
9313  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9314  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
9315  if (!SWIG_IsOK(res2)) {
9316  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_set" "', argument " "2"" of type '" "uint8_t const *""'");
9317  }
9318  arg2 = reinterpret_cast< uint8_t * >(argp2);
9319  ecode3 = SWIG_AsVal_int(obj2, &val3);
9320  if (!SWIG_IsOK(ecode3)) {
9321  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer20_set" "', argument " "3"" of type '" "int""'");
9322  }
9323  arg3 = static_cast< int >(val3);
9324  {
9325  Py_BEGIN_ALLOW_THREADS
9326  try {
9327  (arg1)->set((uint8_t const *)arg2,arg3);
9328  } catch(faiss::FaissException & e) {
9329  PyEval_RestoreThread(_save);
9330 
9331  if (PyErr_Occurred()) {
9332  // some previous code already set the error type.
9333  } else {
9334  PyErr_SetString(PyExc_RuntimeError, e.what());
9335  }
9336  SWIG_fail;
9337  }
9338  Py_END_ALLOW_THREADS
9339  }
9340  resultobj = SWIG_Py_Void();
9341  return resultobj;
9342 fail:
9343  return NULL;
9344 }
9345 
9346 
9347 SWIGINTERN PyObject *_wrap_HammingComputer20_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9348  PyObject *resultobj = 0;
9350  uint8_t *arg2 = (uint8_t *) 0 ;
9351  void *argp1 = 0 ;
9352  int res1 = 0 ;
9353  void *argp2 = 0 ;
9354  int res2 = 0 ;
9355  PyObject * obj0 = 0 ;
9356  PyObject * obj1 = 0 ;
9357  int result;
9358 
9359  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer20_hamming",&obj0,&obj1)) SWIG_fail;
9360  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, 0 | 0 );
9361  if (!SWIG_IsOK(res1)) {
9362  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer20_hamming" "', argument " "1"" of type '" "faiss::HammingComputer20 const *""'");
9363  }
9364  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9365  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
9366  if (!SWIG_IsOK(res2)) {
9367  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer20_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
9368  }
9369  arg2 = reinterpret_cast< uint8_t * >(argp2);
9370  {
9371  Py_BEGIN_ALLOW_THREADS
9372  try {
9373  result = (int)((faiss::HammingComputer20 const *)arg1)->hamming((uint8_t const *)arg2);
9374  } catch(faiss::FaissException & e) {
9375  PyEval_RestoreThread(_save);
9376 
9377  if (PyErr_Occurred()) {
9378  // some previous code already set the error type.
9379  } else {
9380  PyErr_SetString(PyExc_RuntimeError, e.what());
9381  }
9382  SWIG_fail;
9383  }
9384  Py_END_ALLOW_THREADS
9385  }
9386  resultobj = SWIG_From_int(static_cast< int >(result));
9387  return resultobj;
9388 fail:
9389  return NULL;
9390 }
9391 
9392 
9393 SWIGINTERN PyObject *_wrap_delete_HammingComputer20(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9394  PyObject *resultobj = 0;
9396  void *argp1 = 0 ;
9397  int res1 = 0 ;
9398  PyObject * obj0 = 0 ;
9399 
9400  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer20",&obj0)) SWIG_fail;
9401  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer20, SWIG_POINTER_DISOWN | 0 );
9402  if (!SWIG_IsOK(res1)) {
9403  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer20" "', argument " "1"" of type '" "faiss::HammingComputer20 *""'");
9404  }
9405  arg1 = reinterpret_cast< faiss::HammingComputer20 * >(argp1);
9406  delete arg1;
9407  resultobj = SWIG_Py_Void();
9408  return resultobj;
9409 fail:
9410  return NULL;
9411 }
9412 
9413 
9414 SWIGINTERN PyObject *HammingComputer20_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9415  PyObject *obj;
9416  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
9417  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer20, SWIG_NewClientData(obj));
9418  return SWIG_Py_Void();
9419 }
9420 
9421 SWIGINTERN PyObject *_wrap_HammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9422  PyObject *resultobj = 0;
9424  uint64_t arg2 ;
9425  void *argp1 = 0 ;
9426  int res1 = 0 ;
9427  unsigned long val2 ;
9428  int ecode2 = 0 ;
9429  PyObject * obj0 = 0 ;
9430  PyObject * obj1 = 0 ;
9431 
9432  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail;
9433  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9434  if (!SWIG_IsOK(res1)) {
9435  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9436  }
9437  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9438  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9439  if (!SWIG_IsOK(ecode2)) {
9440  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'");
9441  }
9442  arg2 = static_cast< uint64_t >(val2);
9443  if (arg1) (arg1)->a0 = arg2;
9444  resultobj = SWIG_Py_Void();
9445  return resultobj;
9446 fail:
9447  return NULL;
9448 }
9449 
9450 
9451 SWIGINTERN PyObject *_wrap_HammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9452  PyObject *resultobj = 0;
9454  void *argp1 = 0 ;
9455  int res1 = 0 ;
9456  PyObject * obj0 = 0 ;
9457  uint64_t result;
9458 
9459  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a0_get",&obj0)) SWIG_fail;
9460  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9461  if (!SWIG_IsOK(res1)) {
9462  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9463  }
9464  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9465  result = (uint64_t) ((arg1)->a0);
9466  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9467  return resultobj;
9468 fail:
9469  return NULL;
9470 }
9471 
9472 
9473 SWIGINTERN PyObject *_wrap_HammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9474  PyObject *resultobj = 0;
9476  uint64_t arg2 ;
9477  void *argp1 = 0 ;
9478  int res1 = 0 ;
9479  unsigned long val2 ;
9480  int ecode2 = 0 ;
9481  PyObject * obj0 = 0 ;
9482  PyObject * obj1 = 0 ;
9483 
9484  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail;
9485  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9486  if (!SWIG_IsOK(res1)) {
9487  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9488  }
9489  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9490  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9491  if (!SWIG_IsOK(ecode2)) {
9492  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'");
9493  }
9494  arg2 = static_cast< uint64_t >(val2);
9495  if (arg1) (arg1)->a1 = arg2;
9496  resultobj = SWIG_Py_Void();
9497  return resultobj;
9498 fail:
9499  return NULL;
9500 }
9501 
9502 
9503 SWIGINTERN PyObject *_wrap_HammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9504  PyObject *resultobj = 0;
9506  void *argp1 = 0 ;
9507  int res1 = 0 ;
9508  PyObject * obj0 = 0 ;
9509  uint64_t result;
9510 
9511  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a1_get",&obj0)) SWIG_fail;
9512  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9513  if (!SWIG_IsOK(res1)) {
9514  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9515  }
9516  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9517  result = (uint64_t) ((arg1)->a1);
9518  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9519  return resultobj;
9520 fail:
9521  return NULL;
9522 }
9523 
9524 
9525 SWIGINTERN PyObject *_wrap_HammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9526  PyObject *resultobj = 0;
9528  uint64_t arg2 ;
9529  void *argp1 = 0 ;
9530  int res1 = 0 ;
9531  unsigned long val2 ;
9532  int ecode2 = 0 ;
9533  PyObject * obj0 = 0 ;
9534  PyObject * obj1 = 0 ;
9535 
9536  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail;
9537  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9538  if (!SWIG_IsOK(res1)) {
9539  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9540  }
9541  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9542  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9543  if (!SWIG_IsOK(ecode2)) {
9544  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'");
9545  }
9546  arg2 = static_cast< uint64_t >(val2);
9547  if (arg1) (arg1)->a2 = arg2;
9548  resultobj = SWIG_Py_Void();
9549  return resultobj;
9550 fail:
9551  return NULL;
9552 }
9553 
9554 
9555 SWIGINTERN PyObject *_wrap_HammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9556  PyObject *resultobj = 0;
9558  void *argp1 = 0 ;
9559  int res1 = 0 ;
9560  PyObject * obj0 = 0 ;
9561  uint64_t result;
9562 
9563  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a2_get",&obj0)) SWIG_fail;
9564  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9565  if (!SWIG_IsOK(res1)) {
9566  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9567  }
9568  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9569  result = (uint64_t) ((arg1)->a2);
9570  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9571  return resultobj;
9572 fail:
9573  return NULL;
9574 }
9575 
9576 
9577 SWIGINTERN PyObject *_wrap_HammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9578  PyObject *resultobj = 0;
9580  uint64_t arg2 ;
9581  void *argp1 = 0 ;
9582  int res1 = 0 ;
9583  unsigned long val2 ;
9584  int ecode2 = 0 ;
9585  PyObject * obj0 = 0 ;
9586  PyObject * obj1 = 0 ;
9587 
9588  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail;
9589  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9590  if (!SWIG_IsOK(res1)) {
9591  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9592  }
9593  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9594  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9595  if (!SWIG_IsOK(ecode2)) {
9596  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'");
9597  }
9598  arg2 = static_cast< uint64_t >(val2);
9599  if (arg1) (arg1)->a3 = arg2;
9600  resultobj = SWIG_Py_Void();
9601  return resultobj;
9602 fail:
9603  return NULL;
9604 }
9605 
9606 
9607 SWIGINTERN PyObject *_wrap_HammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9608  PyObject *resultobj = 0;
9610  void *argp1 = 0 ;
9611  int res1 = 0 ;
9612  PyObject * obj0 = 0 ;
9613  uint64_t result;
9614 
9615  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer32_a3_get",&obj0)) SWIG_fail;
9616  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9617  if (!SWIG_IsOK(res1)) {
9618  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9619  }
9620  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9621  result = (uint64_t) ((arg1)->a3);
9622  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9623  return resultobj;
9624 fail:
9625  return NULL;
9626 }
9627 
9628 
9629 SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9630  PyObject *resultobj = 0;
9631  faiss::HammingComputer32 *result = 0 ;
9632 
9633  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer32")) SWIG_fail;
9634  {
9635  Py_BEGIN_ALLOW_THREADS
9636  try {
9638  } catch(faiss::FaissException & e) {
9639  PyEval_RestoreThread(_save);
9640 
9641  if (PyErr_Occurred()) {
9642  // some previous code already set the error type.
9643  } else {
9644  PyErr_SetString(PyExc_RuntimeError, e.what());
9645  }
9646  SWIG_fail;
9647  }
9648  Py_END_ALLOW_THREADS
9649  }
9650  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 );
9651  return resultobj;
9652 fail:
9653  return NULL;
9654 }
9655 
9656 
9657 SWIGINTERN PyObject *_wrap_new_HammingComputer32__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9658  PyObject *resultobj = 0;
9659  uint8_t *arg1 = (uint8_t *) 0 ;
9660  int arg2 ;
9661  void *argp1 = 0 ;
9662  int res1 = 0 ;
9663  int val2 ;
9664  int ecode2 = 0 ;
9665  PyObject * obj0 = 0 ;
9666  PyObject * obj1 = 0 ;
9667  faiss::HammingComputer32 *result = 0 ;
9668 
9669  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer32",&obj0,&obj1)) SWIG_fail;
9670  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
9671  if (!SWIG_IsOK(res1)) {
9672  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'");
9673  }
9674  arg1 = reinterpret_cast< uint8_t * >(argp1);
9675  ecode2 = SWIG_AsVal_int(obj1, &val2);
9676  if (!SWIG_IsOK(ecode2)) {
9677  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer32" "', argument " "2"" of type '" "int""'");
9678  }
9679  arg2 = static_cast< int >(val2);
9680  {
9681  Py_BEGIN_ALLOW_THREADS
9682  try {
9683  result = (faiss::HammingComputer32 *)new faiss::HammingComputer32((uint8_t const *)arg1,arg2);
9684  } catch(faiss::FaissException & e) {
9685  PyEval_RestoreThread(_save);
9686 
9687  if (PyErr_Occurred()) {
9688  // some previous code already set the error type.
9689  } else {
9690  PyErr_SetString(PyExc_RuntimeError, e.what());
9691  }
9692  SWIG_fail;
9693  }
9694  Py_END_ALLOW_THREADS
9695  }
9696  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_NEW | 0 );
9697  return resultobj;
9698 fail:
9699  return NULL;
9700 }
9701 
9702 
9703 SWIGINTERN PyObject *_wrap_new_HammingComputer32(PyObject *self, PyObject *args) {
9704  Py_ssize_t argc;
9705  PyObject *argv[3] = {
9706  0
9707  };
9708  Py_ssize_t ii;
9709 
9710  if (!PyTuple_Check(args)) SWIG_fail;
9711  argc = args ? PyObject_Length(args) : 0;
9712  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
9713  argv[ii] = PyTuple_GET_ITEM(args,ii);
9714  }
9715  if (argc == 0) {
9716  return _wrap_new_HammingComputer32__SWIG_0(self, args);
9717  }
9718  if (argc == 2) {
9719  int _v;
9720  void *vptr = 0;
9721  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
9722  _v = SWIG_CheckState(res);
9723  if (_v) {
9724  {
9725  int res = SWIG_AsVal_int(argv[1], NULL);
9726  _v = SWIG_CheckState(res);
9727  }
9728  if (_v) {
9729  return _wrap_new_HammingComputer32__SWIG_1(self, args);
9730  }
9731  }
9732  }
9733 
9734 fail:
9735  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer32'.\n"
9736  " Possible C/C++ prototypes are:\n"
9737  " faiss::HammingComputer32::HammingComputer32()\n"
9738  " faiss::HammingComputer32::HammingComputer32(uint8_t const *,int)\n");
9739  return 0;
9740 }
9741 
9742 
9743 SWIGINTERN PyObject *_wrap_HammingComputer32_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9744  PyObject *resultobj = 0;
9746  uint8_t *arg2 = (uint8_t *) 0 ;
9747  int arg3 ;
9748  void *argp1 = 0 ;
9749  int res1 = 0 ;
9750  void *argp2 = 0 ;
9751  int res2 = 0 ;
9752  int val3 ;
9753  int ecode3 = 0 ;
9754  PyObject * obj0 = 0 ;
9755  PyObject * obj1 = 0 ;
9756  PyObject * obj2 = 0 ;
9757 
9758  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer32_set",&obj0,&obj1,&obj2)) SWIG_fail;
9759  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9760  if (!SWIG_IsOK(res1)) {
9761  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_set" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9762  }
9763  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9764  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
9765  if (!SWIG_IsOK(res2)) {
9766  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_set" "', argument " "2"" of type '" "uint8_t const *""'");
9767  }
9768  arg2 = reinterpret_cast< uint8_t * >(argp2);
9769  ecode3 = SWIG_AsVal_int(obj2, &val3);
9770  if (!SWIG_IsOK(ecode3)) {
9771  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer32_set" "', argument " "3"" of type '" "int""'");
9772  }
9773  arg3 = static_cast< int >(val3);
9774  {
9775  Py_BEGIN_ALLOW_THREADS
9776  try {
9777  (arg1)->set((uint8_t const *)arg2,arg3);
9778  } catch(faiss::FaissException & e) {
9779  PyEval_RestoreThread(_save);
9780 
9781  if (PyErr_Occurred()) {
9782  // some previous code already set the error type.
9783  } else {
9784  PyErr_SetString(PyExc_RuntimeError, e.what());
9785  }
9786  SWIG_fail;
9787  }
9788  Py_END_ALLOW_THREADS
9789  }
9790  resultobj = SWIG_Py_Void();
9791  return resultobj;
9792 fail:
9793  return NULL;
9794 }
9795 
9796 
9797 SWIGINTERN PyObject *_wrap_HammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9798  PyObject *resultobj = 0;
9800  uint8_t *arg2 = (uint8_t *) 0 ;
9801  void *argp1 = 0 ;
9802  int res1 = 0 ;
9803  void *argp2 = 0 ;
9804  int res2 = 0 ;
9805  PyObject * obj0 = 0 ;
9806  PyObject * obj1 = 0 ;
9807  int result;
9808 
9809  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer32_hamming",&obj0,&obj1)) SWIG_fail;
9810  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, 0 | 0 );
9811  if (!SWIG_IsOK(res1)) {
9812  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer32_hamming" "', argument " "1"" of type '" "faiss::HammingComputer32 const *""'");
9813  }
9814  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9815  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
9816  if (!SWIG_IsOK(res2)) {
9817  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
9818  }
9819  arg2 = reinterpret_cast< uint8_t * >(argp2);
9820  {
9821  Py_BEGIN_ALLOW_THREADS
9822  try {
9823  result = (int)((faiss::HammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2);
9824  } catch(faiss::FaissException & e) {
9825  PyEval_RestoreThread(_save);
9826 
9827  if (PyErr_Occurred()) {
9828  // some previous code already set the error type.
9829  } else {
9830  PyErr_SetString(PyExc_RuntimeError, e.what());
9831  }
9832  SWIG_fail;
9833  }
9834  Py_END_ALLOW_THREADS
9835  }
9836  resultobj = SWIG_From_int(static_cast< int >(result));
9837  return resultobj;
9838 fail:
9839  return NULL;
9840 }
9841 
9842 
9843 SWIGINTERN PyObject *_wrap_delete_HammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9844  PyObject *resultobj = 0;
9846  void *argp1 = 0 ;
9847  int res1 = 0 ;
9848  PyObject * obj0 = 0 ;
9849 
9850  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer32",&obj0)) SWIG_fail;
9851  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer32, SWIG_POINTER_DISOWN | 0 );
9852  if (!SWIG_IsOK(res1)) {
9853  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer32" "', argument " "1"" of type '" "faiss::HammingComputer32 *""'");
9854  }
9855  arg1 = reinterpret_cast< faiss::HammingComputer32 * >(argp1);
9856  delete arg1;
9857  resultobj = SWIG_Py_Void();
9858  return resultobj;
9859 fail:
9860  return NULL;
9861 }
9862 
9863 
9864 SWIGINTERN PyObject *HammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9865  PyObject *obj;
9866  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
9867  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer32, SWIG_NewClientData(obj));
9868  return SWIG_Py_Void();
9869 }
9870 
9871 SWIGINTERN PyObject *_wrap_HammingComputer64_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9872  PyObject *resultobj = 0;
9874  uint64_t arg2 ;
9875  void *argp1 = 0 ;
9876  int res1 = 0 ;
9877  unsigned long val2 ;
9878  int ecode2 = 0 ;
9879  PyObject * obj0 = 0 ;
9880  PyObject * obj1 = 0 ;
9881 
9882  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a0_set",&obj0,&obj1)) SWIG_fail;
9883  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
9884  if (!SWIG_IsOK(res1)) {
9885  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
9886  }
9887  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
9888  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9889  if (!SWIG_IsOK(ecode2)) {
9890  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a0_set" "', argument " "2"" of type '" "uint64_t""'");
9891  }
9892  arg2 = static_cast< uint64_t >(val2);
9893  if (arg1) (arg1)->a0 = arg2;
9894  resultobj = SWIG_Py_Void();
9895  return resultobj;
9896 fail:
9897  return NULL;
9898 }
9899 
9900 
9901 SWIGINTERN PyObject *_wrap_HammingComputer64_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9902  PyObject *resultobj = 0;
9904  void *argp1 = 0 ;
9905  int res1 = 0 ;
9906  PyObject * obj0 = 0 ;
9907  uint64_t result;
9908 
9909  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a0_get",&obj0)) SWIG_fail;
9910  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
9911  if (!SWIG_IsOK(res1)) {
9912  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a0_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
9913  }
9914  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
9915  result = (uint64_t) ((arg1)->a0);
9916  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9917  return resultobj;
9918 fail:
9919  return NULL;
9920 }
9921 
9922 
9923 SWIGINTERN PyObject *_wrap_HammingComputer64_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9924  PyObject *resultobj = 0;
9926  uint64_t arg2 ;
9927  void *argp1 = 0 ;
9928  int res1 = 0 ;
9929  unsigned long val2 ;
9930  int ecode2 = 0 ;
9931  PyObject * obj0 = 0 ;
9932  PyObject * obj1 = 0 ;
9933 
9934  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a1_set",&obj0,&obj1)) SWIG_fail;
9935  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
9936  if (!SWIG_IsOK(res1)) {
9937  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
9938  }
9939  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
9940  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9941  if (!SWIG_IsOK(ecode2)) {
9942  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a1_set" "', argument " "2"" of type '" "uint64_t""'");
9943  }
9944  arg2 = static_cast< uint64_t >(val2);
9945  if (arg1) (arg1)->a1 = arg2;
9946  resultobj = SWIG_Py_Void();
9947  return resultobj;
9948 fail:
9949  return NULL;
9950 }
9951 
9952 
9953 SWIGINTERN PyObject *_wrap_HammingComputer64_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9954  PyObject *resultobj = 0;
9956  void *argp1 = 0 ;
9957  int res1 = 0 ;
9958  PyObject * obj0 = 0 ;
9959  uint64_t result;
9960 
9961  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a1_get",&obj0)) SWIG_fail;
9962  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
9963  if (!SWIG_IsOK(res1)) {
9964  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a1_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
9965  }
9966  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
9967  result = (uint64_t) ((arg1)->a1);
9968  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
9969  return resultobj;
9970 fail:
9971  return NULL;
9972 }
9973 
9974 
9975 SWIGINTERN PyObject *_wrap_HammingComputer64_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9976  PyObject *resultobj = 0;
9978  uint64_t arg2 ;
9979  void *argp1 = 0 ;
9980  int res1 = 0 ;
9981  unsigned long val2 ;
9982  int ecode2 = 0 ;
9983  PyObject * obj0 = 0 ;
9984  PyObject * obj1 = 0 ;
9985 
9986  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a2_set",&obj0,&obj1)) SWIG_fail;
9987  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
9988  if (!SWIG_IsOK(res1)) {
9989  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
9990  }
9991  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
9992  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
9993  if (!SWIG_IsOK(ecode2)) {
9994  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a2_set" "', argument " "2"" of type '" "uint64_t""'");
9995  }
9996  arg2 = static_cast< uint64_t >(val2);
9997  if (arg1) (arg1)->a2 = arg2;
9998  resultobj = SWIG_Py_Void();
9999  return resultobj;
10000 fail:
10001  return NULL;
10002 }
10003 
10004 
10005 SWIGINTERN PyObject *_wrap_HammingComputer64_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10006  PyObject *resultobj = 0;
10008  void *argp1 = 0 ;
10009  int res1 = 0 ;
10010  PyObject * obj0 = 0 ;
10011  uint64_t result;
10012 
10013  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a2_get",&obj0)) SWIG_fail;
10014  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10015  if (!SWIG_IsOK(res1)) {
10016  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a2_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10017  }
10018  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10019  result = (uint64_t) ((arg1)->a2);
10020  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10021  return resultobj;
10022 fail:
10023  return NULL;
10024 }
10025 
10026 
10027 SWIGINTERN PyObject *_wrap_HammingComputer64_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10028  PyObject *resultobj = 0;
10030  uint64_t arg2 ;
10031  void *argp1 = 0 ;
10032  int res1 = 0 ;
10033  unsigned long val2 ;
10034  int ecode2 = 0 ;
10035  PyObject * obj0 = 0 ;
10036  PyObject * obj1 = 0 ;
10037 
10038  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a3_set",&obj0,&obj1)) SWIG_fail;
10039  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10040  if (!SWIG_IsOK(res1)) {
10041  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10042  }
10043  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10044  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
10045  if (!SWIG_IsOK(ecode2)) {
10046  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a3_set" "', argument " "2"" of type '" "uint64_t""'");
10047  }
10048  arg2 = static_cast< uint64_t >(val2);
10049  if (arg1) (arg1)->a3 = arg2;
10050  resultobj = SWIG_Py_Void();
10051  return resultobj;
10052 fail:
10053  return NULL;
10054 }
10055 
10056 
10057 SWIGINTERN PyObject *_wrap_HammingComputer64_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10058  PyObject *resultobj = 0;
10060  void *argp1 = 0 ;
10061  int res1 = 0 ;
10062  PyObject * obj0 = 0 ;
10063  uint64_t result;
10064 
10065  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a3_get",&obj0)) SWIG_fail;
10066  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10067  if (!SWIG_IsOK(res1)) {
10068  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a3_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10069  }
10070  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10071  result = (uint64_t) ((arg1)->a3);
10072  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10073  return resultobj;
10074 fail:
10075  return NULL;
10076 }
10077 
10078 
10079 SWIGINTERN PyObject *_wrap_HammingComputer64_a4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10080  PyObject *resultobj = 0;
10082  uint64_t arg2 ;
10083  void *argp1 = 0 ;
10084  int res1 = 0 ;
10085  unsigned long val2 ;
10086  int ecode2 = 0 ;
10087  PyObject * obj0 = 0 ;
10088  PyObject * obj1 = 0 ;
10089 
10090  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a4_set",&obj0,&obj1)) SWIG_fail;
10091  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10092  if (!SWIG_IsOK(res1)) {
10093  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10094  }
10095  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10096  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
10097  if (!SWIG_IsOK(ecode2)) {
10098  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a4_set" "', argument " "2"" of type '" "uint64_t""'");
10099  }
10100  arg2 = static_cast< uint64_t >(val2);
10101  if (arg1) (arg1)->a4 = arg2;
10102  resultobj = SWIG_Py_Void();
10103  return resultobj;
10104 fail:
10105  return NULL;
10106 }
10107 
10108 
10109 SWIGINTERN PyObject *_wrap_HammingComputer64_a4_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10110  PyObject *resultobj = 0;
10112  void *argp1 = 0 ;
10113  int res1 = 0 ;
10114  PyObject * obj0 = 0 ;
10115  uint64_t result;
10116 
10117  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a4_get",&obj0)) SWIG_fail;
10118  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10119  if (!SWIG_IsOK(res1)) {
10120  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a4_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10121  }
10122  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10123  result = (uint64_t) ((arg1)->a4);
10124  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10125  return resultobj;
10126 fail:
10127  return NULL;
10128 }
10129 
10130 
10131 SWIGINTERN PyObject *_wrap_HammingComputer64_a5_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10132  PyObject *resultobj = 0;
10134  uint64_t arg2 ;
10135  void *argp1 = 0 ;
10136  int res1 = 0 ;
10137  unsigned long val2 ;
10138  int ecode2 = 0 ;
10139  PyObject * obj0 = 0 ;
10140  PyObject * obj1 = 0 ;
10141 
10142  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a5_set",&obj0,&obj1)) SWIG_fail;
10143  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10144  if (!SWIG_IsOK(res1)) {
10145  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10146  }
10147  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10148  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
10149  if (!SWIG_IsOK(ecode2)) {
10150  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a5_set" "', argument " "2"" of type '" "uint64_t""'");
10151  }
10152  arg2 = static_cast< uint64_t >(val2);
10153  if (arg1) (arg1)->a5 = arg2;
10154  resultobj = SWIG_Py_Void();
10155  return resultobj;
10156 fail:
10157  return NULL;
10158 }
10159 
10160 
10161 SWIGINTERN PyObject *_wrap_HammingComputer64_a5_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10162  PyObject *resultobj = 0;
10164  void *argp1 = 0 ;
10165  int res1 = 0 ;
10166  PyObject * obj0 = 0 ;
10167  uint64_t result;
10168 
10169  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a5_get",&obj0)) SWIG_fail;
10170  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10171  if (!SWIG_IsOK(res1)) {
10172  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a5_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10173  }
10174  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10175  result = (uint64_t) ((arg1)->a5);
10176  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10177  return resultobj;
10178 fail:
10179  return NULL;
10180 }
10181 
10182 
10183 SWIGINTERN PyObject *_wrap_HammingComputer64_a6_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10184  PyObject *resultobj = 0;
10186  uint64_t arg2 ;
10187  void *argp1 = 0 ;
10188  int res1 = 0 ;
10189  unsigned long val2 ;
10190  int ecode2 = 0 ;
10191  PyObject * obj0 = 0 ;
10192  PyObject * obj1 = 0 ;
10193 
10194  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a6_set",&obj0,&obj1)) SWIG_fail;
10195  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10196  if (!SWIG_IsOK(res1)) {
10197  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10198  }
10199  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10200  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
10201  if (!SWIG_IsOK(ecode2)) {
10202  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a6_set" "', argument " "2"" of type '" "uint64_t""'");
10203  }
10204  arg2 = static_cast< uint64_t >(val2);
10205  if (arg1) (arg1)->a6 = arg2;
10206  resultobj = SWIG_Py_Void();
10207  return resultobj;
10208 fail:
10209  return NULL;
10210 }
10211 
10212 
10213 SWIGINTERN PyObject *_wrap_HammingComputer64_a6_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10214  PyObject *resultobj = 0;
10216  void *argp1 = 0 ;
10217  int res1 = 0 ;
10218  PyObject * obj0 = 0 ;
10219  uint64_t result;
10220 
10221  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a6_get",&obj0)) SWIG_fail;
10222  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10223  if (!SWIG_IsOK(res1)) {
10224  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a6_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10225  }
10226  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10227  result = (uint64_t) ((arg1)->a6);
10228  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10229  return resultobj;
10230 fail:
10231  return NULL;
10232 }
10233 
10234 
10235 SWIGINTERN PyObject *_wrap_HammingComputer64_a7_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10236  PyObject *resultobj = 0;
10238  uint64_t arg2 ;
10239  void *argp1 = 0 ;
10240  int res1 = 0 ;
10241  unsigned long val2 ;
10242  int ecode2 = 0 ;
10243  PyObject * obj0 = 0 ;
10244  PyObject * obj1 = 0 ;
10245 
10246  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_a7_set",&obj0,&obj1)) SWIG_fail;
10247  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10248  if (!SWIG_IsOK(res1)) {
10249  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10250  }
10251  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10252  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
10253  if (!SWIG_IsOK(ecode2)) {
10254  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputer64_a7_set" "', argument " "2"" of type '" "uint64_t""'");
10255  }
10256  arg2 = static_cast< uint64_t >(val2);
10257  if (arg1) (arg1)->a7 = arg2;
10258  resultobj = SWIG_Py_Void();
10259  return resultobj;
10260 fail:
10261  return NULL;
10262 }
10263 
10264 
10265 SWIGINTERN PyObject *_wrap_HammingComputer64_a7_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10266  PyObject *resultobj = 0;
10268  void *argp1 = 0 ;
10269  int res1 = 0 ;
10270  PyObject * obj0 = 0 ;
10271  uint64_t result;
10272 
10273  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputer64_a7_get",&obj0)) SWIG_fail;
10274  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10275  if (!SWIG_IsOK(res1)) {
10276  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_a7_get" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10277  }
10278  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10279  result = (uint64_t) ((arg1)->a7);
10280  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
10281  return resultobj;
10282 fail:
10283  return NULL;
10284 }
10285 
10286 
10287 SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10288  PyObject *resultobj = 0;
10289  faiss::HammingComputer64 *result = 0 ;
10290 
10291  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputer64")) SWIG_fail;
10292  {
10293  Py_BEGIN_ALLOW_THREADS
10294  try {
10296  } catch(faiss::FaissException & e) {
10297  PyEval_RestoreThread(_save);
10298 
10299  if (PyErr_Occurred()) {
10300  // some previous code already set the error type.
10301  } else {
10302  PyErr_SetString(PyExc_RuntimeError, e.what());
10303  }
10304  SWIG_fail;
10305  }
10306  Py_END_ALLOW_THREADS
10307  }
10308  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 );
10309  return resultobj;
10310 fail:
10311  return NULL;
10312 }
10313 
10314 
10315 SWIGINTERN PyObject *_wrap_new_HammingComputer64__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10316  PyObject *resultobj = 0;
10317  uint8_t *arg1 = (uint8_t *) 0 ;
10318  int arg2 ;
10319  void *argp1 = 0 ;
10320  int res1 = 0 ;
10321  int val2 ;
10322  int ecode2 = 0 ;
10323  PyObject * obj0 = 0 ;
10324  PyObject * obj1 = 0 ;
10325  faiss::HammingComputer64 *result = 0 ;
10326 
10327  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputer64",&obj0,&obj1)) SWIG_fail;
10328  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
10329  if (!SWIG_IsOK(res1)) {
10330  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputer64" "', argument " "1"" of type '" "uint8_t const *""'");
10331  }
10332  arg1 = reinterpret_cast< uint8_t * >(argp1);
10333  ecode2 = SWIG_AsVal_int(obj1, &val2);
10334  if (!SWIG_IsOK(ecode2)) {
10335  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputer64" "', argument " "2"" of type '" "int""'");
10336  }
10337  arg2 = static_cast< int >(val2);
10338  {
10339  Py_BEGIN_ALLOW_THREADS
10340  try {
10341  result = (faiss::HammingComputer64 *)new faiss::HammingComputer64((uint8_t const *)arg1,arg2);
10342  } catch(faiss::FaissException & e) {
10343  PyEval_RestoreThread(_save);
10344 
10345  if (PyErr_Occurred()) {
10346  // some previous code already set the error type.
10347  } else {
10348  PyErr_SetString(PyExc_RuntimeError, e.what());
10349  }
10350  SWIG_fail;
10351  }
10352  Py_END_ALLOW_THREADS
10353  }
10354  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_NEW | 0 );
10355  return resultobj;
10356 fail:
10357  return NULL;
10358 }
10359 
10360 
10361 SWIGINTERN PyObject *_wrap_new_HammingComputer64(PyObject *self, PyObject *args) {
10362  Py_ssize_t argc;
10363  PyObject *argv[3] = {
10364  0
10365  };
10366  Py_ssize_t ii;
10367 
10368  if (!PyTuple_Check(args)) SWIG_fail;
10369  argc = args ? PyObject_Length(args) : 0;
10370  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
10371  argv[ii] = PyTuple_GET_ITEM(args,ii);
10372  }
10373  if (argc == 0) {
10374  return _wrap_new_HammingComputer64__SWIG_0(self, args);
10375  }
10376  if (argc == 2) {
10377  int _v;
10378  void *vptr = 0;
10379  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
10380  _v = SWIG_CheckState(res);
10381  if (_v) {
10382  {
10383  int res = SWIG_AsVal_int(argv[1], NULL);
10384  _v = SWIG_CheckState(res);
10385  }
10386  if (_v) {
10387  return _wrap_new_HammingComputer64__SWIG_1(self, args);
10388  }
10389  }
10390  }
10391 
10392 fail:
10393  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputer64'.\n"
10394  " Possible C/C++ prototypes are:\n"
10395  " faiss::HammingComputer64::HammingComputer64()\n"
10396  " faiss::HammingComputer64::HammingComputer64(uint8_t const *,int)\n");
10397  return 0;
10398 }
10399 
10400 
10401 SWIGINTERN PyObject *_wrap_HammingComputer64_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10402  PyObject *resultobj = 0;
10404  uint8_t *arg2 = (uint8_t *) 0 ;
10405  int arg3 ;
10406  void *argp1 = 0 ;
10407  int res1 = 0 ;
10408  void *argp2 = 0 ;
10409  int res2 = 0 ;
10410  int val3 ;
10411  int ecode3 = 0 ;
10412  PyObject * obj0 = 0 ;
10413  PyObject * obj1 = 0 ;
10414  PyObject * obj2 = 0 ;
10415 
10416  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputer64_set",&obj0,&obj1,&obj2)) SWIG_fail;
10417  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10418  if (!SWIG_IsOK(res1)) {
10419  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_set" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10420  }
10421  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10422  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
10423  if (!SWIG_IsOK(res2)) {
10424  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_set" "', argument " "2"" of type '" "uint8_t const *""'");
10425  }
10426  arg2 = reinterpret_cast< uint8_t * >(argp2);
10427  ecode3 = SWIG_AsVal_int(obj2, &val3);
10428  if (!SWIG_IsOK(ecode3)) {
10429  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputer64_set" "', argument " "3"" of type '" "int""'");
10430  }
10431  arg3 = static_cast< int >(val3);
10432  {
10433  Py_BEGIN_ALLOW_THREADS
10434  try {
10435  (arg1)->set((uint8_t const *)arg2,arg3);
10436  } catch(faiss::FaissException & e) {
10437  PyEval_RestoreThread(_save);
10438 
10439  if (PyErr_Occurred()) {
10440  // some previous code already set the error type.
10441  } else {
10442  PyErr_SetString(PyExc_RuntimeError, e.what());
10443  }
10444  SWIG_fail;
10445  }
10446  Py_END_ALLOW_THREADS
10447  }
10448  resultobj = SWIG_Py_Void();
10449  return resultobj;
10450 fail:
10451  return NULL;
10452 }
10453 
10454 
10455 SWIGINTERN PyObject *_wrap_HammingComputer64_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10456  PyObject *resultobj = 0;
10458  uint8_t *arg2 = (uint8_t *) 0 ;
10459  void *argp1 = 0 ;
10460  int res1 = 0 ;
10461  void *argp2 = 0 ;
10462  int res2 = 0 ;
10463  PyObject * obj0 = 0 ;
10464  PyObject * obj1 = 0 ;
10465  int result;
10466 
10467  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputer64_hamming",&obj0,&obj1)) SWIG_fail;
10468  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, 0 | 0 );
10469  if (!SWIG_IsOK(res1)) {
10470  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputer64_hamming" "', argument " "1"" of type '" "faiss::HammingComputer64 const *""'");
10471  }
10472  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10473  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
10474  if (!SWIG_IsOK(res2)) {
10475  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputer64_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
10476  }
10477  arg2 = reinterpret_cast< uint8_t * >(argp2);
10478  {
10479  Py_BEGIN_ALLOW_THREADS
10480  try {
10481  result = (int)((faiss::HammingComputer64 const *)arg1)->hamming((uint8_t const *)arg2);
10482  } catch(faiss::FaissException & e) {
10483  PyEval_RestoreThread(_save);
10484 
10485  if (PyErr_Occurred()) {
10486  // some previous code already set the error type.
10487  } else {
10488  PyErr_SetString(PyExc_RuntimeError, e.what());
10489  }
10490  SWIG_fail;
10491  }
10492  Py_END_ALLOW_THREADS
10493  }
10494  resultobj = SWIG_From_int(static_cast< int >(result));
10495  return resultobj;
10496 fail:
10497  return NULL;
10498 }
10499 
10500 
10501 SWIGINTERN PyObject *_wrap_delete_HammingComputer64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10502  PyObject *resultobj = 0;
10504  void *argp1 = 0 ;
10505  int res1 = 0 ;
10506  PyObject * obj0 = 0 ;
10507 
10508  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputer64",&obj0)) SWIG_fail;
10509  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputer64, SWIG_POINTER_DISOWN | 0 );
10510  if (!SWIG_IsOK(res1)) {
10511  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputer64" "', argument " "1"" of type '" "faiss::HammingComputer64 *""'");
10512  }
10513  arg1 = reinterpret_cast< faiss::HammingComputer64 * >(argp1);
10514  delete arg1;
10515  resultobj = SWIG_Py_Void();
10516  return resultobj;
10517 fail:
10518  return NULL;
10519 }
10520 
10521 
10522 SWIGINTERN PyObject *HammingComputer64_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10523  PyObject *obj;
10524  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
10525  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputer64, SWIG_NewClientData(obj));
10526  return SWIG_Py_Void();
10527 }
10528 
10529 SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10530  PyObject *resultobj = 0;
10532  uint8_t *arg2 = (uint8_t *) 0 ;
10533  void *argp1 = 0 ;
10534  int res1 = 0 ;
10535  void *argp2 = 0 ;
10536  int res2 = 0 ;
10537  PyObject * obj0 = 0 ;
10538  PyObject * obj1 = 0 ;
10539 
10540  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_a_set",&obj0,&obj1)) SWIG_fail;
10541  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10542  if (!SWIG_IsOK(res1)) {
10543  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10544  }
10545  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10546  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 );
10547  if (!SWIG_IsOK(res2)) {
10548  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_a_set" "', argument " "2"" of type '" "uint8_t const *""'");
10549  }
10550  arg2 = reinterpret_cast< uint8_t * >(argp2);
10551  if (arg1) (arg1)->a = (uint8_t const *)arg2;
10552  resultobj = SWIG_Py_Void();
10553  return resultobj;
10554 fail:
10555  return NULL;
10556 }
10557 
10558 
10559 SWIGINTERN PyObject *_wrap_HammingComputerDefault_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10560  PyObject *resultobj = 0;
10562  void *argp1 = 0 ;
10563  int res1 = 0 ;
10564  PyObject * obj0 = 0 ;
10565  uint8_t *result = 0 ;
10566 
10567  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_a_get",&obj0)) SWIG_fail;
10568  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10569  if (!SWIG_IsOK(res1)) {
10570  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_a_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10571  }
10572  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10573  result = (uint8_t *) ((arg1)->a);
10574  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 );
10575  return resultobj;
10576 fail:
10577  return NULL;
10578 }
10579 
10580 
10581 SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10582  PyObject *resultobj = 0;
10584  int arg2 ;
10585  void *argp1 = 0 ;
10586  int res1 = 0 ;
10587  int val2 ;
10588  int ecode2 = 0 ;
10589  PyObject * obj0 = 0 ;
10590  PyObject * obj1 = 0 ;
10591 
10592  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_n_set",&obj0,&obj1)) SWIG_fail;
10593  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10594  if (!SWIG_IsOK(res1)) {
10595  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10596  }
10597  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10598  ecode2 = SWIG_AsVal_int(obj1, &val2);
10599  if (!SWIG_IsOK(ecode2)) {
10600  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerDefault_n_set" "', argument " "2"" of type '" "int""'");
10601  }
10602  arg2 = static_cast< int >(val2);
10603  if (arg1) (arg1)->n = arg2;
10604  resultobj = SWIG_Py_Void();
10605  return resultobj;
10606 fail:
10607  return NULL;
10608 }
10609 
10610 
10611 SWIGINTERN PyObject *_wrap_HammingComputerDefault_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10612  PyObject *resultobj = 0;
10614  void *argp1 = 0 ;
10615  int res1 = 0 ;
10616  PyObject * obj0 = 0 ;
10617  int result;
10618 
10619  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerDefault_n_get",&obj0)) SWIG_fail;
10620  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10621  if (!SWIG_IsOK(res1)) {
10622  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_n_get" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10623  }
10624  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10625  result = (int) ((arg1)->n);
10626  resultobj = SWIG_From_int(static_cast< int >(result));
10627  return resultobj;
10628 fail:
10629  return NULL;
10630 }
10631 
10632 
10633 SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10634  PyObject *resultobj = 0;
10635  faiss::HammingComputerDefault *result = 0 ;
10636 
10637  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerDefault")) SWIG_fail;
10638  {
10639  Py_BEGIN_ALLOW_THREADS
10640  try {
10642  } catch(faiss::FaissException & e) {
10643  PyEval_RestoreThread(_save);
10644 
10645  if (PyErr_Occurred()) {
10646  // some previous code already set the error type.
10647  } else {
10648  PyErr_SetString(PyExc_RuntimeError, e.what());
10649  }
10650  SWIG_fail;
10651  }
10652  Py_END_ALLOW_THREADS
10653  }
10654  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 );
10655  return resultobj;
10656 fail:
10657  return NULL;
10658 }
10659 
10660 
10661 SWIGINTERN PyObject *_wrap_new_HammingComputerDefault__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10662  PyObject *resultobj = 0;
10663  uint8_t *arg1 = (uint8_t *) 0 ;
10664  int arg2 ;
10665  void *argp1 = 0 ;
10666  int res1 = 0 ;
10667  int val2 ;
10668  int ecode2 = 0 ;
10669  PyObject * obj0 = 0 ;
10670  PyObject * obj1 = 0 ;
10671  faiss::HammingComputerDefault *result = 0 ;
10672 
10673  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerDefault",&obj0,&obj1)) SWIG_fail;
10674  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
10675  if (!SWIG_IsOK(res1)) {
10676  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerDefault" "', argument " "1"" of type '" "uint8_t const *""'");
10677  }
10678  arg1 = reinterpret_cast< uint8_t * >(argp1);
10679  ecode2 = SWIG_AsVal_int(obj1, &val2);
10680  if (!SWIG_IsOK(ecode2)) {
10681  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerDefault" "', argument " "2"" of type '" "int""'");
10682  }
10683  arg2 = static_cast< int >(val2);
10684  {
10685  Py_BEGIN_ALLOW_THREADS
10686  try {
10687  result = (faiss::HammingComputerDefault *)new faiss::HammingComputerDefault((uint8_t const *)arg1,arg2);
10688  } catch(faiss::FaissException & e) {
10689  PyEval_RestoreThread(_save);
10690 
10691  if (PyErr_Occurred()) {
10692  // some previous code already set the error type.
10693  } else {
10694  PyErr_SetString(PyExc_RuntimeError, e.what());
10695  }
10696  SWIG_fail;
10697  }
10698  Py_END_ALLOW_THREADS
10699  }
10700  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_NEW | 0 );
10701  return resultobj;
10702 fail:
10703  return NULL;
10704 }
10705 
10706 
10707 SWIGINTERN PyObject *_wrap_new_HammingComputerDefault(PyObject *self, PyObject *args) {
10708  Py_ssize_t argc;
10709  PyObject *argv[3] = {
10710  0
10711  };
10712  Py_ssize_t ii;
10713 
10714  if (!PyTuple_Check(args)) SWIG_fail;
10715  argc = args ? PyObject_Length(args) : 0;
10716  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
10717  argv[ii] = PyTuple_GET_ITEM(args,ii);
10718  }
10719  if (argc == 0) {
10720  return _wrap_new_HammingComputerDefault__SWIG_0(self, args);
10721  }
10722  if (argc == 2) {
10723  int _v;
10724  void *vptr = 0;
10725  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
10726  _v = SWIG_CheckState(res);
10727  if (_v) {
10728  {
10729  int res = SWIG_AsVal_int(argv[1], NULL);
10730  _v = SWIG_CheckState(res);
10731  }
10732  if (_v) {
10733  return _wrap_new_HammingComputerDefault__SWIG_1(self, args);
10734  }
10735  }
10736  }
10737 
10738 fail:
10739  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerDefault'.\n"
10740  " Possible C/C++ prototypes are:\n"
10741  " faiss::HammingComputerDefault::HammingComputerDefault()\n"
10742  " faiss::HammingComputerDefault::HammingComputerDefault(uint8_t const *,int)\n");
10743  return 0;
10744 }
10745 
10746 
10747 SWIGINTERN PyObject *_wrap_HammingComputerDefault_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10748  PyObject *resultobj = 0;
10750  uint8_t *arg2 = (uint8_t *) 0 ;
10751  int arg3 ;
10752  void *argp1 = 0 ;
10753  int res1 = 0 ;
10754  void *argp2 = 0 ;
10755  int res2 = 0 ;
10756  int val3 ;
10757  int ecode3 = 0 ;
10758  PyObject * obj0 = 0 ;
10759  PyObject * obj1 = 0 ;
10760  PyObject * obj2 = 0 ;
10761 
10762  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerDefault_set",&obj0,&obj1,&obj2)) SWIG_fail;
10763  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10764  if (!SWIG_IsOK(res1)) {
10765  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_set" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10766  }
10767  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10768  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
10769  if (!SWIG_IsOK(res2)) {
10770  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_set" "', argument " "2"" of type '" "uint8_t const *""'");
10771  }
10772  arg2 = reinterpret_cast< uint8_t * >(argp2);
10773  ecode3 = SWIG_AsVal_int(obj2, &val3);
10774  if (!SWIG_IsOK(ecode3)) {
10775  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerDefault_set" "', argument " "3"" of type '" "int""'");
10776  }
10777  arg3 = static_cast< int >(val3);
10778  {
10779  Py_BEGIN_ALLOW_THREADS
10780  try {
10781  (arg1)->set((uint8_t const *)arg2,arg3);
10782  } catch(faiss::FaissException & e) {
10783  PyEval_RestoreThread(_save);
10784 
10785  if (PyErr_Occurred()) {
10786  // some previous code already set the error type.
10787  } else {
10788  PyErr_SetString(PyExc_RuntimeError, e.what());
10789  }
10790  SWIG_fail;
10791  }
10792  Py_END_ALLOW_THREADS
10793  }
10794  resultobj = SWIG_Py_Void();
10795  return resultobj;
10796 fail:
10797  return NULL;
10798 }
10799 
10800 
10801 SWIGINTERN PyObject *_wrap_HammingComputerDefault_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10802  PyObject *resultobj = 0;
10804  uint8_t *arg2 = (uint8_t *) 0 ;
10805  void *argp1 = 0 ;
10806  int res1 = 0 ;
10807  void *argp2 = 0 ;
10808  int res2 = 0 ;
10809  PyObject * obj0 = 0 ;
10810  PyObject * obj1 = 0 ;
10811  int result;
10812 
10813  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerDefault_hamming",&obj0,&obj1)) SWIG_fail;
10814  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, 0 | 0 );
10815  if (!SWIG_IsOK(res1)) {
10816  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerDefault_hamming" "', argument " "1"" of type '" "faiss::HammingComputerDefault const *""'");
10817  }
10818  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10819  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
10820  if (!SWIG_IsOK(res2)) {
10821  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerDefault_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
10822  }
10823  arg2 = reinterpret_cast< uint8_t * >(argp2);
10824  {
10825  Py_BEGIN_ALLOW_THREADS
10826  try {
10827  result = (int)((faiss::HammingComputerDefault const *)arg1)->hamming((uint8_t const *)arg2);
10828  } catch(faiss::FaissException & e) {
10829  PyEval_RestoreThread(_save);
10830 
10831  if (PyErr_Occurred()) {
10832  // some previous code already set the error type.
10833  } else {
10834  PyErr_SetString(PyExc_RuntimeError, e.what());
10835  }
10836  SWIG_fail;
10837  }
10838  Py_END_ALLOW_THREADS
10839  }
10840  resultobj = SWIG_From_int(static_cast< int >(result));
10841  return resultobj;
10842 fail:
10843  return NULL;
10844 }
10845 
10846 
10847 SWIGINTERN PyObject *_wrap_delete_HammingComputerDefault(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10848  PyObject *resultobj = 0;
10850  void *argp1 = 0 ;
10851  int res1 = 0 ;
10852  PyObject * obj0 = 0 ;
10853 
10854  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerDefault",&obj0)) SWIG_fail;
10855  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_POINTER_DISOWN | 0 );
10856  if (!SWIG_IsOK(res1)) {
10857  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerDefault" "', argument " "1"" of type '" "faiss::HammingComputerDefault *""'");
10858  }
10859  arg1 = reinterpret_cast< faiss::HammingComputerDefault * >(argp1);
10860  delete arg1;
10861  resultobj = SWIG_Py_Void();
10862  return resultobj;
10863 fail:
10864  return NULL;
10865 }
10866 
10867 
10868 SWIGINTERN PyObject *HammingComputerDefault_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10869  PyObject *obj;
10870  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
10871  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerDefault, SWIG_NewClientData(obj));
10872  return SWIG_Py_Void();
10873 }
10874 
10875 SWIGINTERN PyObject *_wrap_HammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10876  PyObject *resultobj = 0;
10878  uint64_t *arg2 = (uint64_t *) 0 ;
10879  void *argp1 = 0 ;
10880  int res1 = 0 ;
10881  void *argp2 = 0 ;
10882  int res2 = 0 ;
10883  PyObject * obj0 = 0 ;
10884  PyObject * obj1 = 0 ;
10885 
10886  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail;
10887  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
10888  if (!SWIG_IsOK(res1)) {
10889  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
10890  }
10891  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
10892  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 );
10893  if (!SWIG_IsOK(res2)) {
10894  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'");
10895  }
10896  arg2 = reinterpret_cast< uint64_t * >(argp2);
10897  if (arg1) (arg1)->a = (uint64_t const *)arg2;
10898  resultobj = SWIG_Py_Void();
10899  return resultobj;
10900 fail:
10901  return NULL;
10902 }
10903 
10904 
10905 SWIGINTERN PyObject *_wrap_HammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10906  PyObject *resultobj = 0;
10908  void *argp1 = 0 ;
10909  int res1 = 0 ;
10910  PyObject * obj0 = 0 ;
10911  uint64_t *result = 0 ;
10912 
10913  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_a_get",&obj0)) SWIG_fail;
10914  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
10915  if (!SWIG_IsOK(res1)) {
10916  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
10917  }
10918  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
10919  result = (uint64_t *) ((arg1)->a);
10920  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 );
10921  return resultobj;
10922 fail:
10923  return NULL;
10924 }
10925 
10926 
10927 SWIGINTERN PyObject *_wrap_HammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10928  PyObject *resultobj = 0;
10930  int arg2 ;
10931  void *argp1 = 0 ;
10932  int res1 = 0 ;
10933  int val2 ;
10934  int ecode2 = 0 ;
10935  PyObject * obj0 = 0 ;
10936  PyObject * obj1 = 0 ;
10937 
10938  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail;
10939  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
10940  if (!SWIG_IsOK(res1)) {
10941  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
10942  }
10943  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
10944  ecode2 = SWIG_AsVal_int(obj1, &val2);
10945  if (!SWIG_IsOK(ecode2)) {
10946  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM8_n_set" "', argument " "2"" of type '" "int""'");
10947  }
10948  arg2 = static_cast< int >(val2);
10949  if (arg1) (arg1)->n = arg2;
10950  resultobj = SWIG_Py_Void();
10951  return resultobj;
10952 fail:
10953  return NULL;
10954 }
10955 
10956 
10957 SWIGINTERN PyObject *_wrap_HammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10958  PyObject *resultobj = 0;
10960  void *argp1 = 0 ;
10961  int res1 = 0 ;
10962  PyObject * obj0 = 0 ;
10963  int result;
10964 
10965  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM8_n_get",&obj0)) SWIG_fail;
10966  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
10967  if (!SWIG_IsOK(res1)) {
10968  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
10969  }
10970  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
10971  result = (int) ((arg1)->n);
10972  resultobj = SWIG_From_int(static_cast< int >(result));
10973  return resultobj;
10974 fail:
10975  return NULL;
10976 }
10977 
10978 
10979 SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10980  PyObject *resultobj = 0;
10981  faiss::HammingComputerM8 *result = 0 ;
10982 
10983  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM8")) SWIG_fail;
10984  {
10985  Py_BEGIN_ALLOW_THREADS
10986  try {
10988  } catch(faiss::FaissException & e) {
10989  PyEval_RestoreThread(_save);
10990 
10991  if (PyErr_Occurred()) {
10992  // some previous code already set the error type.
10993  } else {
10994  PyErr_SetString(PyExc_RuntimeError, e.what());
10995  }
10996  SWIG_fail;
10997  }
10998  Py_END_ALLOW_THREADS
10999  }
11000  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 );
11001  return resultobj;
11002 fail:
11003  return NULL;
11004 }
11005 
11006 
11007 SWIGINTERN PyObject *_wrap_new_HammingComputerM8__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11008  PyObject *resultobj = 0;
11009  uint8_t *arg1 = (uint8_t *) 0 ;
11010  int arg2 ;
11011  void *argp1 = 0 ;
11012  int res1 = 0 ;
11013  int val2 ;
11014  int ecode2 = 0 ;
11015  PyObject * obj0 = 0 ;
11016  PyObject * obj1 = 0 ;
11017  faiss::HammingComputerM8 *result = 0 ;
11018 
11019  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM8",&obj0,&obj1)) SWIG_fail;
11020  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
11021  if (!SWIG_IsOK(res1)) {
11022  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'");
11023  }
11024  arg1 = reinterpret_cast< uint8_t * >(argp1);
11025  ecode2 = SWIG_AsVal_int(obj1, &val2);
11026  if (!SWIG_IsOK(ecode2)) {
11027  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM8" "', argument " "2"" of type '" "int""'");
11028  }
11029  arg2 = static_cast< int >(val2);
11030  {
11031  Py_BEGIN_ALLOW_THREADS
11032  try {
11033  result = (faiss::HammingComputerM8 *)new faiss::HammingComputerM8((uint8_t const *)arg1,arg2);
11034  } catch(faiss::FaissException & e) {
11035  PyEval_RestoreThread(_save);
11036 
11037  if (PyErr_Occurred()) {
11038  // some previous code already set the error type.
11039  } else {
11040  PyErr_SetString(PyExc_RuntimeError, e.what());
11041  }
11042  SWIG_fail;
11043  }
11044  Py_END_ALLOW_THREADS
11045  }
11046  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_NEW | 0 );
11047  return resultobj;
11048 fail:
11049  return NULL;
11050 }
11051 
11052 
11053 SWIGINTERN PyObject *_wrap_new_HammingComputerM8(PyObject *self, PyObject *args) {
11054  Py_ssize_t argc;
11055  PyObject *argv[3] = {
11056  0
11057  };
11058  Py_ssize_t ii;
11059 
11060  if (!PyTuple_Check(args)) SWIG_fail;
11061  argc = args ? PyObject_Length(args) : 0;
11062  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
11063  argv[ii] = PyTuple_GET_ITEM(args,ii);
11064  }
11065  if (argc == 0) {
11066  return _wrap_new_HammingComputerM8__SWIG_0(self, args);
11067  }
11068  if (argc == 2) {
11069  int _v;
11070  void *vptr = 0;
11071  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
11072  _v = SWIG_CheckState(res);
11073  if (_v) {
11074  {
11075  int res = SWIG_AsVal_int(argv[1], NULL);
11076  _v = SWIG_CheckState(res);
11077  }
11078  if (_v) {
11079  return _wrap_new_HammingComputerM8__SWIG_1(self, args);
11080  }
11081  }
11082  }
11083 
11084 fail:
11085  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM8'.\n"
11086  " Possible C/C++ prototypes are:\n"
11087  " faiss::HammingComputerM8::HammingComputerM8()\n"
11088  " faiss::HammingComputerM8::HammingComputerM8(uint8_t const *,int)\n");
11089  return 0;
11090 }
11091 
11092 
11093 SWIGINTERN PyObject *_wrap_HammingComputerM8_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11094  PyObject *resultobj = 0;
11096  uint8_t *arg2 = (uint8_t *) 0 ;
11097  int arg3 ;
11098  void *argp1 = 0 ;
11099  int res1 = 0 ;
11100  void *argp2 = 0 ;
11101  int res2 = 0 ;
11102  int val3 ;
11103  int ecode3 = 0 ;
11104  PyObject * obj0 = 0 ;
11105  PyObject * obj1 = 0 ;
11106  PyObject * obj2 = 0 ;
11107 
11108  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM8_set",&obj0,&obj1,&obj2)) SWIG_fail;
11109  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
11110  if (!SWIG_IsOK(res1)) {
11111  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_set" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
11112  }
11113  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
11114  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11115  if (!SWIG_IsOK(res2)) {
11116  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_set" "', argument " "2"" of type '" "uint8_t const *""'");
11117  }
11118  arg2 = reinterpret_cast< uint8_t * >(argp2);
11119  ecode3 = SWIG_AsVal_int(obj2, &val3);
11120  if (!SWIG_IsOK(ecode3)) {
11121  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM8_set" "', argument " "3"" of type '" "int""'");
11122  }
11123  arg3 = static_cast< int >(val3);
11124  {
11125  Py_BEGIN_ALLOW_THREADS
11126  try {
11127  (arg1)->set((uint8_t const *)arg2,arg3);
11128  } catch(faiss::FaissException & e) {
11129  PyEval_RestoreThread(_save);
11130 
11131  if (PyErr_Occurred()) {
11132  // some previous code already set the error type.
11133  } else {
11134  PyErr_SetString(PyExc_RuntimeError, e.what());
11135  }
11136  SWIG_fail;
11137  }
11138  Py_END_ALLOW_THREADS
11139  }
11140  resultobj = SWIG_Py_Void();
11141  return resultobj;
11142 fail:
11143  return NULL;
11144 }
11145 
11146 
11147 SWIGINTERN PyObject *_wrap_HammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11148  PyObject *resultobj = 0;
11150  uint8_t *arg2 = (uint8_t *) 0 ;
11151  void *argp1 = 0 ;
11152  int res1 = 0 ;
11153  void *argp2 = 0 ;
11154  int res2 = 0 ;
11155  PyObject * obj0 = 0 ;
11156  PyObject * obj1 = 0 ;
11157  int result;
11158 
11159  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail;
11160  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, 0 | 0 );
11161  if (!SWIG_IsOK(res1)) {
11162  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM8 const *""'");
11163  }
11164  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
11165  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11166  if (!SWIG_IsOK(res2)) {
11167  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
11168  }
11169  arg2 = reinterpret_cast< uint8_t * >(argp2);
11170  {
11171  Py_BEGIN_ALLOW_THREADS
11172  try {
11173  result = (int)((faiss::HammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2);
11174  } catch(faiss::FaissException & e) {
11175  PyEval_RestoreThread(_save);
11176 
11177  if (PyErr_Occurred()) {
11178  // some previous code already set the error type.
11179  } else {
11180  PyErr_SetString(PyExc_RuntimeError, e.what());
11181  }
11182  SWIG_fail;
11183  }
11184  Py_END_ALLOW_THREADS
11185  }
11186  resultobj = SWIG_From_int(static_cast< int >(result));
11187  return resultobj;
11188 fail:
11189  return NULL;
11190 }
11191 
11192 
11193 SWIGINTERN PyObject *_wrap_delete_HammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11194  PyObject *resultobj = 0;
11196  void *argp1 = 0 ;
11197  int res1 = 0 ;
11198  PyObject * obj0 = 0 ;
11199 
11200  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM8",&obj0)) SWIG_fail;
11201  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM8, SWIG_POINTER_DISOWN | 0 );
11202  if (!SWIG_IsOK(res1)) {
11203  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM8" "', argument " "1"" of type '" "faiss::HammingComputerM8 *""'");
11204  }
11205  arg1 = reinterpret_cast< faiss::HammingComputerM8 * >(argp1);
11206  delete arg1;
11207  resultobj = SWIG_Py_Void();
11208  return resultobj;
11209 fail:
11210  return NULL;
11211 }
11212 
11213 
11214 SWIGINTERN PyObject *HammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11215  PyObject *obj;
11216  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11217  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM8, SWIG_NewClientData(obj));
11218  return SWIG_Py_Void();
11219 }
11220 
11221 SWIGINTERN PyObject *_wrap_HammingComputerM4_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11222  PyObject *resultobj = 0;
11224  uint32_t *arg2 = (uint32_t *) 0 ;
11225  void *argp1 = 0 ;
11226  int res1 = 0 ;
11227  void *argp2 = 0 ;
11228  int res2 = 0 ;
11229  PyObject * obj0 = 0 ;
11230  PyObject * obj1 = 0 ;
11231 
11232  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_a_set",&obj0,&obj1)) SWIG_fail;
11233  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11234  if (!SWIG_IsOK(res1)) {
11235  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11236  }
11237  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11238  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_uint32_t, SWIG_POINTER_DISOWN | 0 );
11239  if (!SWIG_IsOK(res2)) {
11240  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_a_set" "', argument " "2"" of type '" "uint32_t const *""'");
11241  }
11242  arg2 = reinterpret_cast< uint32_t * >(argp2);
11243  if (arg1) (arg1)->a = (uint32_t const *)arg2;
11244  resultobj = SWIG_Py_Void();
11245  return resultobj;
11246 fail:
11247  return NULL;
11248 }
11249 
11250 
11251 SWIGINTERN PyObject *_wrap_HammingComputerM4_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11252  PyObject *resultobj = 0;
11254  void *argp1 = 0 ;
11255  int res1 = 0 ;
11256  PyObject * obj0 = 0 ;
11257  uint32_t *result = 0 ;
11258 
11259  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_a_get",&obj0)) SWIG_fail;
11260  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11261  if (!SWIG_IsOK(res1)) {
11262  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_a_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11263  }
11264  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11265  result = (uint32_t *) ((arg1)->a);
11266  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_uint32_t, 0 | 0 );
11267  return resultobj;
11268 fail:
11269  return NULL;
11270 }
11271 
11272 
11273 SWIGINTERN PyObject *_wrap_HammingComputerM4_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11274  PyObject *resultobj = 0;
11276  int arg2 ;
11277  void *argp1 = 0 ;
11278  int res1 = 0 ;
11279  int val2 ;
11280  int ecode2 = 0 ;
11281  PyObject * obj0 = 0 ;
11282  PyObject * obj1 = 0 ;
11283 
11284  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_n_set",&obj0,&obj1)) SWIG_fail;
11285  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11286  if (!SWIG_IsOK(res1)) {
11287  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11288  }
11289  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11290  ecode2 = SWIG_AsVal_int(obj1, &val2);
11291  if (!SWIG_IsOK(ecode2)) {
11292  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "HammingComputerM4_n_set" "', argument " "2"" of type '" "int""'");
11293  }
11294  arg2 = static_cast< int >(val2);
11295  if (arg1) (arg1)->n = arg2;
11296  resultobj = SWIG_Py_Void();
11297  return resultobj;
11298 fail:
11299  return NULL;
11300 }
11301 
11302 
11303 SWIGINTERN PyObject *_wrap_HammingComputerM4_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11304  PyObject *resultobj = 0;
11306  void *argp1 = 0 ;
11307  int res1 = 0 ;
11308  PyObject * obj0 = 0 ;
11309  int result;
11310 
11311  if (!PyArg_ParseTuple(args,(char *)"O:HammingComputerM4_n_get",&obj0)) SWIG_fail;
11312  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11313  if (!SWIG_IsOK(res1)) {
11314  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_n_get" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11315  }
11316  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11317  result = (int) ((arg1)->n);
11318  resultobj = SWIG_From_int(static_cast< int >(result));
11319  return resultobj;
11320 fail:
11321  return NULL;
11322 }
11323 
11324 
11325 SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11326  PyObject *resultobj = 0;
11327  faiss::HammingComputerM4 *result = 0 ;
11328 
11329  if (!PyArg_ParseTuple(args,(char *)":new_HammingComputerM4")) SWIG_fail;
11330  {
11331  Py_BEGIN_ALLOW_THREADS
11332  try {
11334  } catch(faiss::FaissException & e) {
11335  PyEval_RestoreThread(_save);
11336 
11337  if (PyErr_Occurred()) {
11338  // some previous code already set the error type.
11339  } else {
11340  PyErr_SetString(PyExc_RuntimeError, e.what());
11341  }
11342  SWIG_fail;
11343  }
11344  Py_END_ALLOW_THREADS
11345  }
11346  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 );
11347  return resultobj;
11348 fail:
11349  return NULL;
11350 }
11351 
11352 
11353 SWIGINTERN PyObject *_wrap_new_HammingComputerM4__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11354  PyObject *resultobj = 0;
11355  uint8_t *arg1 = (uint8_t *) 0 ;
11356  int arg2 ;
11357  void *argp1 = 0 ;
11358  int res1 = 0 ;
11359  int val2 ;
11360  int ecode2 = 0 ;
11361  PyObject * obj0 = 0 ;
11362  PyObject * obj1 = 0 ;
11363  faiss::HammingComputerM4 *result = 0 ;
11364 
11365  if (!PyArg_ParseTuple(args,(char *)"OO:new_HammingComputerM4",&obj0,&obj1)) SWIG_fail;
11366  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
11367  if (!SWIG_IsOK(res1)) {
11368  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HammingComputerM4" "', argument " "1"" of type '" "uint8_t const *""'");
11369  }
11370  arg1 = reinterpret_cast< uint8_t * >(argp1);
11371  ecode2 = SWIG_AsVal_int(obj1, &val2);
11372  if (!SWIG_IsOK(ecode2)) {
11373  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_HammingComputerM4" "', argument " "2"" of type '" "int""'");
11374  }
11375  arg2 = static_cast< int >(val2);
11376  {
11377  Py_BEGIN_ALLOW_THREADS
11378  try {
11379  result = (faiss::HammingComputerM4 *)new faiss::HammingComputerM4((uint8_t const *)arg1,arg2);
11380  } catch(faiss::FaissException & e) {
11381  PyEval_RestoreThread(_save);
11382 
11383  if (PyErr_Occurred()) {
11384  // some previous code already set the error type.
11385  } else {
11386  PyErr_SetString(PyExc_RuntimeError, e.what());
11387  }
11388  SWIG_fail;
11389  }
11390  Py_END_ALLOW_THREADS
11391  }
11392  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_NEW | 0 );
11393  return resultobj;
11394 fail:
11395  return NULL;
11396 }
11397 
11398 
11399 SWIGINTERN PyObject *_wrap_new_HammingComputerM4(PyObject *self, PyObject *args) {
11400  Py_ssize_t argc;
11401  PyObject *argv[3] = {
11402  0
11403  };
11404  Py_ssize_t ii;
11405 
11406  if (!PyTuple_Check(args)) SWIG_fail;
11407  argc = args ? PyObject_Length(args) : 0;
11408  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
11409  argv[ii] = PyTuple_GET_ITEM(args,ii);
11410  }
11411  if (argc == 0) {
11412  return _wrap_new_HammingComputerM4__SWIG_0(self, args);
11413  }
11414  if (argc == 2) {
11415  int _v;
11416  void *vptr = 0;
11417  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_unsigned_char, 0);
11418  _v = SWIG_CheckState(res);
11419  if (_v) {
11420  {
11421  int res = SWIG_AsVal_int(argv[1], NULL);
11422  _v = SWIG_CheckState(res);
11423  }
11424  if (_v) {
11425  return _wrap_new_HammingComputerM4__SWIG_1(self, args);
11426  }
11427  }
11428  }
11429 
11430 fail:
11431  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_HammingComputerM4'.\n"
11432  " Possible C/C++ prototypes are:\n"
11433  " faiss::HammingComputerM4::HammingComputerM4()\n"
11434  " faiss::HammingComputerM4::HammingComputerM4(uint8_t const *,int)\n");
11435  return 0;
11436 }
11437 
11438 
11439 SWIGINTERN PyObject *_wrap_HammingComputerM4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11440  PyObject *resultobj = 0;
11442  uint8_t *arg2 = (uint8_t *) 0 ;
11443  int arg3 ;
11444  void *argp1 = 0 ;
11445  int res1 = 0 ;
11446  void *argp2 = 0 ;
11447  int res2 = 0 ;
11448  int val3 ;
11449  int ecode3 = 0 ;
11450  PyObject * obj0 = 0 ;
11451  PyObject * obj1 = 0 ;
11452  PyObject * obj2 = 0 ;
11453 
11454  if (!PyArg_ParseTuple(args,(char *)"OOO:HammingComputerM4_set",&obj0,&obj1,&obj2)) SWIG_fail;
11455  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11456  if (!SWIG_IsOK(res1)) {
11457  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_set" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11458  }
11459  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11460  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11461  if (!SWIG_IsOK(res2)) {
11462  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_set" "', argument " "2"" of type '" "uint8_t const *""'");
11463  }
11464  arg2 = reinterpret_cast< uint8_t * >(argp2);
11465  ecode3 = SWIG_AsVal_int(obj2, &val3);
11466  if (!SWIG_IsOK(ecode3)) {
11467  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "HammingComputerM4_set" "', argument " "3"" of type '" "int""'");
11468  }
11469  arg3 = static_cast< int >(val3);
11470  {
11471  Py_BEGIN_ALLOW_THREADS
11472  try {
11473  (arg1)->set((uint8_t const *)arg2,arg3);
11474  } catch(faiss::FaissException & e) {
11475  PyEval_RestoreThread(_save);
11476 
11477  if (PyErr_Occurred()) {
11478  // some previous code already set the error type.
11479  } else {
11480  PyErr_SetString(PyExc_RuntimeError, e.what());
11481  }
11482  SWIG_fail;
11483  }
11484  Py_END_ALLOW_THREADS
11485  }
11486  resultobj = SWIG_Py_Void();
11487  return resultobj;
11488 fail:
11489  return NULL;
11490 }
11491 
11492 
11493 SWIGINTERN PyObject *_wrap_HammingComputerM4_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11494  PyObject *resultobj = 0;
11496  uint8_t *arg2 = (uint8_t *) 0 ;
11497  void *argp1 = 0 ;
11498  int res1 = 0 ;
11499  void *argp2 = 0 ;
11500  int res2 = 0 ;
11501  PyObject * obj0 = 0 ;
11502  PyObject * obj1 = 0 ;
11503  int result;
11504 
11505  if (!PyArg_ParseTuple(args,(char *)"OO:HammingComputerM4_hamming",&obj0,&obj1)) SWIG_fail;
11506  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, 0 | 0 );
11507  if (!SWIG_IsOK(res1)) {
11508  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HammingComputerM4_hamming" "', argument " "1"" of type '" "faiss::HammingComputerM4 const *""'");
11509  }
11510  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11511  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11512  if (!SWIG_IsOK(res2)) {
11513  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HammingComputerM4_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
11514  }
11515  arg2 = reinterpret_cast< uint8_t * >(argp2);
11516  {
11517  Py_BEGIN_ALLOW_THREADS
11518  try {
11519  result = (int)((faiss::HammingComputerM4 const *)arg1)->hamming((uint8_t const *)arg2);
11520  } catch(faiss::FaissException & e) {
11521  PyEval_RestoreThread(_save);
11522 
11523  if (PyErr_Occurred()) {
11524  // some previous code already set the error type.
11525  } else {
11526  PyErr_SetString(PyExc_RuntimeError, e.what());
11527  }
11528  SWIG_fail;
11529  }
11530  Py_END_ALLOW_THREADS
11531  }
11532  resultobj = SWIG_From_int(static_cast< int >(result));
11533  return resultobj;
11534 fail:
11535  return NULL;
11536 }
11537 
11538 
11539 SWIGINTERN PyObject *_wrap_delete_HammingComputerM4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11540  PyObject *resultobj = 0;
11542  void *argp1 = 0 ;
11543  int res1 = 0 ;
11544  PyObject * obj0 = 0 ;
11545 
11546  if (!PyArg_ParseTuple(args,(char *)"O:delete_HammingComputerM4",&obj0)) SWIG_fail;
11547  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HammingComputerM4, SWIG_POINTER_DISOWN | 0 );
11548  if (!SWIG_IsOK(res1)) {
11549  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HammingComputerM4" "', argument " "1"" of type '" "faiss::HammingComputerM4 *""'");
11550  }
11551  arg1 = reinterpret_cast< faiss::HammingComputerM4 * >(argp1);
11552  delete arg1;
11553  resultobj = SWIG_Py_Void();
11554  return resultobj;
11555 fail:
11556  return NULL;
11557 }
11558 
11559 
11560 SWIGINTERN PyObject *HammingComputerM4_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11561  PyObject *obj;
11562  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11563  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__HammingComputerM4, SWIG_NewClientData(obj));
11564  return SWIG_Py_Void();
11565 }
11566 
11567 SWIGINTERN PyObject *_wrap_generalized_hamming_64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11568  PyObject *resultobj = 0;
11569  uint64_t arg1 ;
11570  unsigned long val1 ;
11571  int ecode1 = 0 ;
11572  PyObject * obj0 = 0 ;
11573  int result;
11574 
11575  if (!PyArg_ParseTuple(args,(char *)"O:generalized_hamming_64",&obj0)) SWIG_fail;
11576  ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1);
11577  if (!SWIG_IsOK(ecode1)) {
11578  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "generalized_hamming_64" "', argument " "1"" of type '" "uint64_t""'");
11579  }
11580  arg1 = static_cast< uint64_t >(val1);
11581  {
11582  Py_BEGIN_ALLOW_THREADS
11583  try {
11584  result = (int)faiss::generalized_hamming_64(arg1);
11585  } catch(faiss::FaissException & e) {
11586  PyEval_RestoreThread(_save);
11587 
11588  if (PyErr_Occurred()) {
11589  // some previous code already set the error type.
11590  } else {
11591  PyErr_SetString(PyExc_RuntimeError, e.what());
11592  }
11593  SWIG_fail;
11594  }
11595  Py_END_ALLOW_THREADS
11596  }
11597  resultobj = SWIG_From_int(static_cast< int >(result));
11598  return resultobj;
11599 fail:
11600  return NULL;
11601 }
11602 
11603 
11604 SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11605  PyObject *resultobj = 0;
11607  uint64_t arg2 ;
11608  void *argp1 = 0 ;
11609  int res1 = 0 ;
11610  unsigned long val2 ;
11611  int ecode2 = 0 ;
11612  PyObject * obj0 = 0 ;
11613  PyObject * obj1 = 0 ;
11614 
11615  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_a0_set",&obj0,&obj1)) SWIG_fail;
11616  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 );
11617  if (!SWIG_IsOK(res1)) {
11618  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'");
11619  }
11620  arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1);
11621  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
11622  if (!SWIG_IsOK(ecode2)) {
11623  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer8_a0_set" "', argument " "2"" of type '" "uint64_t""'");
11624  }
11625  arg2 = static_cast< uint64_t >(val2);
11626  if (arg1) (arg1)->a0 = arg2;
11627  resultobj = SWIG_Py_Void();
11628  return resultobj;
11629 fail:
11630  return NULL;
11631 }
11632 
11633 
11634 SWIGINTERN PyObject *_wrap_GenHammingComputer8_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11635  PyObject *resultobj = 0;
11637  void *argp1 = 0 ;
11638  int res1 = 0 ;
11639  PyObject * obj0 = 0 ;
11640  uint64_t result;
11641 
11642  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer8_a0_get",&obj0)) SWIG_fail;
11643  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 );
11644  if (!SWIG_IsOK(res1)) {
11645  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'");
11646  }
11647  arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1);
11648  result = (uint64_t) ((arg1)->a0);
11649  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
11650  return resultobj;
11651 fail:
11652  return NULL;
11653 }
11654 
11655 
11656 SWIGINTERN PyObject *_wrap_new_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11657  PyObject *resultobj = 0;
11658  uint8_t *arg1 = (uint8_t *) 0 ;
11659  int arg2 ;
11660  void *argp1 = 0 ;
11661  int res1 = 0 ;
11662  int val2 ;
11663  int ecode2 = 0 ;
11664  PyObject * obj0 = 0 ;
11665  PyObject * obj1 = 0 ;
11666  faiss::GenHammingComputer8 *result = 0 ;
11667 
11668  if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer8",&obj0,&obj1)) SWIG_fail;
11669  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
11670  if (!SWIG_IsOK(res1)) {
11671  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer8" "', argument " "1"" of type '" "uint8_t const *""'");
11672  }
11673  arg1 = reinterpret_cast< uint8_t * >(argp1);
11674  ecode2 = SWIG_AsVal_int(obj1, &val2);
11675  if (!SWIG_IsOK(ecode2)) {
11676  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer8" "', argument " "2"" of type '" "int""'");
11677  }
11678  arg2 = static_cast< int >(val2);
11679  {
11680  Py_BEGIN_ALLOW_THREADS
11681  try {
11682  result = (faiss::GenHammingComputer8 *)new faiss::GenHammingComputer8((uint8_t const *)arg1,arg2);
11683  } catch(faiss::FaissException & e) {
11684  PyEval_RestoreThread(_save);
11685 
11686  if (PyErr_Occurred()) {
11687  // some previous code already set the error type.
11688  } else {
11689  PyErr_SetString(PyExc_RuntimeError, e.what());
11690  }
11691  SWIG_fail;
11692  }
11693  Py_END_ALLOW_THREADS
11694  }
11695  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_NEW | 0 );
11696  return resultobj;
11697 fail:
11698  return NULL;
11699 }
11700 
11701 
11702 SWIGINTERN PyObject *_wrap_GenHammingComputer8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11703  PyObject *resultobj = 0;
11705  uint8_t *arg2 = (uint8_t *) 0 ;
11706  void *argp1 = 0 ;
11707  int res1 = 0 ;
11708  void *argp2 = 0 ;
11709  int res2 = 0 ;
11710  PyObject * obj0 = 0 ;
11711  PyObject * obj1 = 0 ;
11712  int result;
11713 
11714  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer8_hamming",&obj0,&obj1)) SWIG_fail;
11715  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, 0 | 0 );
11716  if (!SWIG_IsOK(res1)) {
11717  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer8 const *""'");
11718  }
11719  arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1);
11720  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11721  if (!SWIG_IsOK(res2)) {
11722  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer8_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
11723  }
11724  arg2 = reinterpret_cast< uint8_t * >(argp2);
11725  {
11726  Py_BEGIN_ALLOW_THREADS
11727  try {
11728  result = (int)((faiss::GenHammingComputer8 const *)arg1)->hamming((uint8_t const *)arg2);
11729  } catch(faiss::FaissException & e) {
11730  PyEval_RestoreThread(_save);
11731 
11732  if (PyErr_Occurred()) {
11733  // some previous code already set the error type.
11734  } else {
11735  PyErr_SetString(PyExc_RuntimeError, e.what());
11736  }
11737  SWIG_fail;
11738  }
11739  Py_END_ALLOW_THREADS
11740  }
11741  resultobj = SWIG_From_int(static_cast< int >(result));
11742  return resultobj;
11743 fail:
11744  return NULL;
11745 }
11746 
11747 
11748 SWIGINTERN PyObject *_wrap_delete_GenHammingComputer8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11749  PyObject *resultobj = 0;
11751  void *argp1 = 0 ;
11752  int res1 = 0 ;
11753  PyObject * obj0 = 0 ;
11754 
11755  if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer8",&obj0)) SWIG_fail;
11756  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_POINTER_DISOWN | 0 );
11757  if (!SWIG_IsOK(res1)) {
11758  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer8" "', argument " "1"" of type '" "faiss::GenHammingComputer8 *""'");
11759  }
11760  arg1 = reinterpret_cast< faiss::GenHammingComputer8 * >(argp1);
11761  delete arg1;
11762  resultobj = SWIG_Py_Void();
11763  return resultobj;
11764 fail:
11765  return NULL;
11766 }
11767 
11768 
11769 SWIGINTERN PyObject *GenHammingComputer8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11770  PyObject *obj;
11771  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11772  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer8, SWIG_NewClientData(obj));
11773  return SWIG_Py_Void();
11774 }
11775 
11776 SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11777  PyObject *resultobj = 0;
11779  uint64_t arg2 ;
11780  void *argp1 = 0 ;
11781  int res1 = 0 ;
11782  unsigned long val2 ;
11783  int ecode2 = 0 ;
11784  PyObject * obj0 = 0 ;
11785  PyObject * obj1 = 0 ;
11786 
11787  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a0_set",&obj0,&obj1)) SWIG_fail;
11788  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 );
11789  if (!SWIG_IsOK(res1)) {
11790  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'");
11791  }
11792  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11793  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
11794  if (!SWIG_IsOK(ecode2)) {
11795  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a0_set" "', argument " "2"" of type '" "uint64_t""'");
11796  }
11797  arg2 = static_cast< uint64_t >(val2);
11798  if (arg1) (arg1)->a0 = arg2;
11799  resultobj = SWIG_Py_Void();
11800  return resultobj;
11801 fail:
11802  return NULL;
11803 }
11804 
11805 
11806 SWIGINTERN PyObject *_wrap_GenHammingComputer16_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11807  PyObject *resultobj = 0;
11809  void *argp1 = 0 ;
11810  int res1 = 0 ;
11811  PyObject * obj0 = 0 ;
11812  uint64_t result;
11813 
11814  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a0_get",&obj0)) SWIG_fail;
11815  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 );
11816  if (!SWIG_IsOK(res1)) {
11817  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'");
11818  }
11819  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11820  result = (uint64_t) ((arg1)->a0);
11821  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
11822  return resultobj;
11823 fail:
11824  return NULL;
11825 }
11826 
11827 
11828 SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11829  PyObject *resultobj = 0;
11831  uint64_t arg2 ;
11832  void *argp1 = 0 ;
11833  int res1 = 0 ;
11834  unsigned long val2 ;
11835  int ecode2 = 0 ;
11836  PyObject * obj0 = 0 ;
11837  PyObject * obj1 = 0 ;
11838 
11839  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_a1_set",&obj0,&obj1)) SWIG_fail;
11840  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 );
11841  if (!SWIG_IsOK(res1)) {
11842  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'");
11843  }
11844  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11845  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
11846  if (!SWIG_IsOK(ecode2)) {
11847  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer16_a1_set" "', argument " "2"" of type '" "uint64_t""'");
11848  }
11849  arg2 = static_cast< uint64_t >(val2);
11850  if (arg1) (arg1)->a1 = arg2;
11851  resultobj = SWIG_Py_Void();
11852  return resultobj;
11853 fail:
11854  return NULL;
11855 }
11856 
11857 
11858 SWIGINTERN PyObject *_wrap_GenHammingComputer16_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11859  PyObject *resultobj = 0;
11861  void *argp1 = 0 ;
11862  int res1 = 0 ;
11863  PyObject * obj0 = 0 ;
11864  uint64_t result;
11865 
11866  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer16_a1_get",&obj0)) SWIG_fail;
11867  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 );
11868  if (!SWIG_IsOK(res1)) {
11869  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'");
11870  }
11871  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11872  result = (uint64_t) ((arg1)->a1);
11873  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
11874  return resultobj;
11875 fail:
11876  return NULL;
11877 }
11878 
11879 
11880 SWIGINTERN PyObject *_wrap_new_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11881  PyObject *resultobj = 0;
11882  uint8_t *arg1 = (uint8_t *) 0 ;
11883  int arg2 ;
11884  void *argp1 = 0 ;
11885  int res1 = 0 ;
11886  int val2 ;
11887  int ecode2 = 0 ;
11888  PyObject * obj0 = 0 ;
11889  PyObject * obj1 = 0 ;
11890  faiss::GenHammingComputer16 *result = 0 ;
11891 
11892  if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer16",&obj0,&obj1)) SWIG_fail;
11893  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
11894  if (!SWIG_IsOK(res1)) {
11895  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer16" "', argument " "1"" of type '" "uint8_t const *""'");
11896  }
11897  arg1 = reinterpret_cast< uint8_t * >(argp1);
11898  ecode2 = SWIG_AsVal_int(obj1, &val2);
11899  if (!SWIG_IsOK(ecode2)) {
11900  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer16" "', argument " "2"" of type '" "int""'");
11901  }
11902  arg2 = static_cast< int >(val2);
11903  {
11904  Py_BEGIN_ALLOW_THREADS
11905  try {
11906  result = (faiss::GenHammingComputer16 *)new faiss::GenHammingComputer16((uint8_t const *)arg1,arg2);
11907  } catch(faiss::FaissException & e) {
11908  PyEval_RestoreThread(_save);
11909 
11910  if (PyErr_Occurred()) {
11911  // some previous code already set the error type.
11912  } else {
11913  PyErr_SetString(PyExc_RuntimeError, e.what());
11914  }
11915  SWIG_fail;
11916  }
11917  Py_END_ALLOW_THREADS
11918  }
11919  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_NEW | 0 );
11920  return resultobj;
11921 fail:
11922  return NULL;
11923 }
11924 
11925 
11926 SWIGINTERN PyObject *_wrap_GenHammingComputer16_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11927  PyObject *resultobj = 0;
11929  uint8_t *arg2 = (uint8_t *) 0 ;
11930  void *argp1 = 0 ;
11931  int res1 = 0 ;
11932  void *argp2 = 0 ;
11933  int res2 = 0 ;
11934  PyObject * obj0 = 0 ;
11935  PyObject * obj1 = 0 ;
11936  int result;
11937 
11938  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer16_hamming",&obj0,&obj1)) SWIG_fail;
11939  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, 0 | 0 );
11940  if (!SWIG_IsOK(res1)) {
11941  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer16_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer16 const *""'");
11942  }
11943  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11944  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
11945  if (!SWIG_IsOK(res2)) {
11946  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer16_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
11947  }
11948  arg2 = reinterpret_cast< uint8_t * >(argp2);
11949  {
11950  Py_BEGIN_ALLOW_THREADS
11951  try {
11952  result = (int)((faiss::GenHammingComputer16 const *)arg1)->hamming((uint8_t const *)arg2);
11953  } catch(faiss::FaissException & e) {
11954  PyEval_RestoreThread(_save);
11955 
11956  if (PyErr_Occurred()) {
11957  // some previous code already set the error type.
11958  } else {
11959  PyErr_SetString(PyExc_RuntimeError, e.what());
11960  }
11961  SWIG_fail;
11962  }
11963  Py_END_ALLOW_THREADS
11964  }
11965  resultobj = SWIG_From_int(static_cast< int >(result));
11966  return resultobj;
11967 fail:
11968  return NULL;
11969 }
11970 
11971 
11972 SWIGINTERN PyObject *_wrap_delete_GenHammingComputer16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11973  PyObject *resultobj = 0;
11975  void *argp1 = 0 ;
11976  int res1 = 0 ;
11977  PyObject * obj0 = 0 ;
11978 
11979  if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer16",&obj0)) SWIG_fail;
11980  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_POINTER_DISOWN | 0 );
11981  if (!SWIG_IsOK(res1)) {
11982  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer16" "', argument " "1"" of type '" "faiss::GenHammingComputer16 *""'");
11983  }
11984  arg1 = reinterpret_cast< faiss::GenHammingComputer16 * >(argp1);
11985  delete arg1;
11986  resultobj = SWIG_Py_Void();
11987  return resultobj;
11988 fail:
11989  return NULL;
11990 }
11991 
11992 
11993 SWIGINTERN PyObject *GenHammingComputer16_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11994  PyObject *obj;
11995  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11996  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer16, SWIG_NewClientData(obj));
11997  return SWIG_Py_Void();
11998 }
11999 
12000 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12001  PyObject *resultobj = 0;
12003  uint64_t arg2 ;
12004  void *argp1 = 0 ;
12005  int res1 = 0 ;
12006  unsigned long val2 ;
12007  int ecode2 = 0 ;
12008  PyObject * obj0 = 0 ;
12009  PyObject * obj1 = 0 ;
12010 
12011  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a0_set",&obj0,&obj1)) SWIG_fail;
12012  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12013  if (!SWIG_IsOK(res1)) {
12014  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12015  }
12016  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12017  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
12018  if (!SWIG_IsOK(ecode2)) {
12019  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a0_set" "', argument " "2"" of type '" "uint64_t""'");
12020  }
12021  arg2 = static_cast< uint64_t >(val2);
12022  if (arg1) (arg1)->a0 = arg2;
12023  resultobj = SWIG_Py_Void();
12024  return resultobj;
12025 fail:
12026  return NULL;
12027 }
12028 
12029 
12030 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12031  PyObject *resultobj = 0;
12033  void *argp1 = 0 ;
12034  int res1 = 0 ;
12035  PyObject * obj0 = 0 ;
12036  uint64_t result;
12037 
12038  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a0_get",&obj0)) SWIG_fail;
12039  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12040  if (!SWIG_IsOK(res1)) {
12041  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a0_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12042  }
12043  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12044  result = (uint64_t) ((arg1)->a0);
12045  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
12046  return resultobj;
12047 fail:
12048  return NULL;
12049 }
12050 
12051 
12052 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12053  PyObject *resultobj = 0;
12055  uint64_t arg2 ;
12056  void *argp1 = 0 ;
12057  int res1 = 0 ;
12058  unsigned long val2 ;
12059  int ecode2 = 0 ;
12060  PyObject * obj0 = 0 ;
12061  PyObject * obj1 = 0 ;
12062 
12063  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a1_set",&obj0,&obj1)) SWIG_fail;
12064  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12065  if (!SWIG_IsOK(res1)) {
12066  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12067  }
12068  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12069  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
12070  if (!SWIG_IsOK(ecode2)) {
12071  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a1_set" "', argument " "2"" of type '" "uint64_t""'");
12072  }
12073  arg2 = static_cast< uint64_t >(val2);
12074  if (arg1) (arg1)->a1 = arg2;
12075  resultobj = SWIG_Py_Void();
12076  return resultobj;
12077 fail:
12078  return NULL;
12079 }
12080 
12081 
12082 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12083  PyObject *resultobj = 0;
12085  void *argp1 = 0 ;
12086  int res1 = 0 ;
12087  PyObject * obj0 = 0 ;
12088  uint64_t result;
12089 
12090  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a1_get",&obj0)) SWIG_fail;
12091  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12092  if (!SWIG_IsOK(res1)) {
12093  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a1_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12094  }
12095  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12096  result = (uint64_t) ((arg1)->a1);
12097  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
12098  return resultobj;
12099 fail:
12100  return NULL;
12101 }
12102 
12103 
12104 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12105  PyObject *resultobj = 0;
12107  uint64_t arg2 ;
12108  void *argp1 = 0 ;
12109  int res1 = 0 ;
12110  unsigned long val2 ;
12111  int ecode2 = 0 ;
12112  PyObject * obj0 = 0 ;
12113  PyObject * obj1 = 0 ;
12114 
12115  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a2_set",&obj0,&obj1)) SWIG_fail;
12116  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12117  if (!SWIG_IsOK(res1)) {
12118  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12119  }
12120  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12121  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
12122  if (!SWIG_IsOK(ecode2)) {
12123  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a2_set" "', argument " "2"" of type '" "uint64_t""'");
12124  }
12125  arg2 = static_cast< uint64_t >(val2);
12126  if (arg1) (arg1)->a2 = arg2;
12127  resultobj = SWIG_Py_Void();
12128  return resultobj;
12129 fail:
12130  return NULL;
12131 }
12132 
12133 
12134 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12135  PyObject *resultobj = 0;
12137  void *argp1 = 0 ;
12138  int res1 = 0 ;
12139  PyObject * obj0 = 0 ;
12140  uint64_t result;
12141 
12142  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a2_get",&obj0)) SWIG_fail;
12143  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12144  if (!SWIG_IsOK(res1)) {
12145  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a2_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12146  }
12147  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12148  result = (uint64_t) ((arg1)->a2);
12149  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
12150  return resultobj;
12151 fail:
12152  return NULL;
12153 }
12154 
12155 
12156 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12157  PyObject *resultobj = 0;
12159  uint64_t arg2 ;
12160  void *argp1 = 0 ;
12161  int res1 = 0 ;
12162  unsigned long val2 ;
12163  int ecode2 = 0 ;
12164  PyObject * obj0 = 0 ;
12165  PyObject * obj1 = 0 ;
12166 
12167  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_a3_set",&obj0,&obj1)) SWIG_fail;
12168  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12169  if (!SWIG_IsOK(res1)) {
12170  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_set" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12171  }
12172  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12173  ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2);
12174  if (!SWIG_IsOK(ecode2)) {
12175  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputer32_a3_set" "', argument " "2"" of type '" "uint64_t""'");
12176  }
12177  arg2 = static_cast< uint64_t >(val2);
12178  if (arg1) (arg1)->a3 = arg2;
12179  resultobj = SWIG_Py_Void();
12180  return resultobj;
12181 fail:
12182  return NULL;
12183 }
12184 
12185 
12186 SWIGINTERN PyObject *_wrap_GenHammingComputer32_a3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12187  PyObject *resultobj = 0;
12189  void *argp1 = 0 ;
12190  int res1 = 0 ;
12191  PyObject * obj0 = 0 ;
12192  uint64_t result;
12193 
12194  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputer32_a3_get",&obj0)) SWIG_fail;
12195  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12196  if (!SWIG_IsOK(res1)) {
12197  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_a3_get" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12198  }
12199  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12200  result = (uint64_t) ((arg1)->a3);
12201  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
12202  return resultobj;
12203 fail:
12204  return NULL;
12205 }
12206 
12207 
12208 SWIGINTERN PyObject *_wrap_new_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12209  PyObject *resultobj = 0;
12210  uint8_t *arg1 = (uint8_t *) 0 ;
12211  int arg2 ;
12212  void *argp1 = 0 ;
12213  int res1 = 0 ;
12214  int val2 ;
12215  int ecode2 = 0 ;
12216  PyObject * obj0 = 0 ;
12217  PyObject * obj1 = 0 ;
12218  faiss::GenHammingComputer32 *result = 0 ;
12219 
12220  if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputer32",&obj0,&obj1)) SWIG_fail;
12221  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
12222  if (!SWIG_IsOK(res1)) {
12223  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputer32" "', argument " "1"" of type '" "uint8_t const *""'");
12224  }
12225  arg1 = reinterpret_cast< uint8_t * >(argp1);
12226  ecode2 = SWIG_AsVal_int(obj1, &val2);
12227  if (!SWIG_IsOK(ecode2)) {
12228  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputer32" "', argument " "2"" of type '" "int""'");
12229  }
12230  arg2 = static_cast< int >(val2);
12231  {
12232  Py_BEGIN_ALLOW_THREADS
12233  try {
12234  result = (faiss::GenHammingComputer32 *)new faiss::GenHammingComputer32((uint8_t const *)arg1,arg2);
12235  } catch(faiss::FaissException & e) {
12236  PyEval_RestoreThread(_save);
12237 
12238  if (PyErr_Occurred()) {
12239  // some previous code already set the error type.
12240  } else {
12241  PyErr_SetString(PyExc_RuntimeError, e.what());
12242  }
12243  SWIG_fail;
12244  }
12245  Py_END_ALLOW_THREADS
12246  }
12247  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_NEW | 0 );
12248  return resultobj;
12249 fail:
12250  return NULL;
12251 }
12252 
12253 
12254 SWIGINTERN PyObject *_wrap_GenHammingComputer32_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12255  PyObject *resultobj = 0;
12257  uint8_t *arg2 = (uint8_t *) 0 ;
12258  void *argp1 = 0 ;
12259  int res1 = 0 ;
12260  void *argp2 = 0 ;
12261  int res2 = 0 ;
12262  PyObject * obj0 = 0 ;
12263  PyObject * obj1 = 0 ;
12264  int result;
12265 
12266  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputer32_hamming",&obj0,&obj1)) SWIG_fail;
12267  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, 0 | 0 );
12268  if (!SWIG_IsOK(res1)) {
12269  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputer32_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputer32 const *""'");
12270  }
12271  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12272  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
12273  if (!SWIG_IsOK(res2)) {
12274  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputer32_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
12275  }
12276  arg2 = reinterpret_cast< uint8_t * >(argp2);
12277  {
12278  Py_BEGIN_ALLOW_THREADS
12279  try {
12280  result = (int)((faiss::GenHammingComputer32 const *)arg1)->hamming((uint8_t const *)arg2);
12281  } catch(faiss::FaissException & e) {
12282  PyEval_RestoreThread(_save);
12283 
12284  if (PyErr_Occurred()) {
12285  // some previous code already set the error type.
12286  } else {
12287  PyErr_SetString(PyExc_RuntimeError, e.what());
12288  }
12289  SWIG_fail;
12290  }
12291  Py_END_ALLOW_THREADS
12292  }
12293  resultobj = SWIG_From_int(static_cast< int >(result));
12294  return resultobj;
12295 fail:
12296  return NULL;
12297 }
12298 
12299 
12300 SWIGINTERN PyObject *_wrap_delete_GenHammingComputer32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12301  PyObject *resultobj = 0;
12303  void *argp1 = 0 ;
12304  int res1 = 0 ;
12305  PyObject * obj0 = 0 ;
12306 
12307  if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputer32",&obj0)) SWIG_fail;
12308  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_POINTER_DISOWN | 0 );
12309  if (!SWIG_IsOK(res1)) {
12310  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputer32" "', argument " "1"" of type '" "faiss::GenHammingComputer32 *""'");
12311  }
12312  arg1 = reinterpret_cast< faiss::GenHammingComputer32 * >(argp1);
12313  delete arg1;
12314  resultobj = SWIG_Py_Void();
12315  return resultobj;
12316 fail:
12317  return NULL;
12318 }
12319 
12320 
12321 SWIGINTERN PyObject *GenHammingComputer32_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12322  PyObject *obj;
12323  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
12324  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputer32, SWIG_NewClientData(obj));
12325  return SWIG_Py_Void();
12326 }
12327 
12328 SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12329  PyObject *resultobj = 0;
12331  uint64_t *arg2 = (uint64_t *) 0 ;
12332  void *argp1 = 0 ;
12333  int res1 = 0 ;
12334  void *argp2 = 0 ;
12335  int res2 = 0 ;
12336  PyObject * obj0 = 0 ;
12337  PyObject * obj1 = 0 ;
12338 
12339  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_a_set",&obj0,&obj1)) SWIG_fail;
12340  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 );
12341  if (!SWIG_IsOK(res1)) {
12342  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'");
12343  }
12344  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12345  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, SWIG_POINTER_DISOWN | 0 );
12346  if (!SWIG_IsOK(res2)) {
12347  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_a_set" "', argument " "2"" of type '" "uint64_t const *""'");
12348  }
12349  arg2 = reinterpret_cast< uint64_t * >(argp2);
12350  if (arg1) (arg1)->a = (uint64_t const *)arg2;
12351  resultobj = SWIG_Py_Void();
12352  return resultobj;
12353 fail:
12354  return NULL;
12355 }
12356 
12357 
12358 SWIGINTERN PyObject *_wrap_GenHammingComputerM8_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12359  PyObject *resultobj = 0;
12361  void *argp1 = 0 ;
12362  int res1 = 0 ;
12363  PyObject * obj0 = 0 ;
12364  uint64_t *result = 0 ;
12365 
12366  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_a_get",&obj0)) SWIG_fail;
12367  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 );
12368  if (!SWIG_IsOK(res1)) {
12369  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_a_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'");
12370  }
12371  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12372  result = (uint64_t *) ((arg1)->a);
12373  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_long, 0 | 0 );
12374  return resultobj;
12375 fail:
12376  return NULL;
12377 }
12378 
12379 
12380 SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12381  PyObject *resultobj = 0;
12383  int arg2 ;
12384  void *argp1 = 0 ;
12385  int res1 = 0 ;
12386  int val2 ;
12387  int ecode2 = 0 ;
12388  PyObject * obj0 = 0 ;
12389  PyObject * obj1 = 0 ;
12390 
12391  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_n_set",&obj0,&obj1)) SWIG_fail;
12392  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 );
12393  if (!SWIG_IsOK(res1)) {
12394  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_set" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'");
12395  }
12396  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12397  ecode2 = SWIG_AsVal_int(obj1, &val2);
12398  if (!SWIG_IsOK(ecode2)) {
12399  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GenHammingComputerM8_n_set" "', argument " "2"" of type '" "int""'");
12400  }
12401  arg2 = static_cast< int >(val2);
12402  if (arg1) (arg1)->n = arg2;
12403  resultobj = SWIG_Py_Void();
12404  return resultobj;
12405 fail:
12406  return NULL;
12407 }
12408 
12409 
12410 SWIGINTERN PyObject *_wrap_GenHammingComputerM8_n_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12411  PyObject *resultobj = 0;
12413  void *argp1 = 0 ;
12414  int res1 = 0 ;
12415  PyObject * obj0 = 0 ;
12416  int result;
12417 
12418  if (!PyArg_ParseTuple(args,(char *)"O:GenHammingComputerM8_n_get",&obj0)) SWIG_fail;
12419  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 );
12420  if (!SWIG_IsOK(res1)) {
12421  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_n_get" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'");
12422  }
12423  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12424  result = (int) ((arg1)->n);
12425  resultobj = SWIG_From_int(static_cast< int >(result));
12426  return resultobj;
12427 fail:
12428  return NULL;
12429 }
12430 
12431 
12432 SWIGINTERN PyObject *_wrap_new_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12433  PyObject *resultobj = 0;
12434  uint8_t *arg1 = (uint8_t *) 0 ;
12435  int arg2 ;
12436  void *argp1 = 0 ;
12437  int res1 = 0 ;
12438  int val2 ;
12439  int ecode2 = 0 ;
12440  PyObject * obj0 = 0 ;
12441  PyObject * obj1 = 0 ;
12442  faiss::GenHammingComputerM8 *result = 0 ;
12443 
12444  if (!PyArg_ParseTuple(args,(char *)"OO:new_GenHammingComputerM8",&obj0,&obj1)) SWIG_fail;
12445  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
12446  if (!SWIG_IsOK(res1)) {
12447  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GenHammingComputerM8" "', argument " "1"" of type '" "uint8_t const *""'");
12448  }
12449  arg1 = reinterpret_cast< uint8_t * >(argp1);
12450  ecode2 = SWIG_AsVal_int(obj1, &val2);
12451  if (!SWIG_IsOK(ecode2)) {
12452  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GenHammingComputerM8" "', argument " "2"" of type '" "int""'");
12453  }
12454  arg2 = static_cast< int >(val2);
12455  {
12456  Py_BEGIN_ALLOW_THREADS
12457  try {
12458  result = (faiss::GenHammingComputerM8 *)new faiss::GenHammingComputerM8((uint8_t const *)arg1,arg2);
12459  } catch(faiss::FaissException & e) {
12460  PyEval_RestoreThread(_save);
12461 
12462  if (PyErr_Occurred()) {
12463  // some previous code already set the error type.
12464  } else {
12465  PyErr_SetString(PyExc_RuntimeError, e.what());
12466  }
12467  SWIG_fail;
12468  }
12469  Py_END_ALLOW_THREADS
12470  }
12471  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_NEW | 0 );
12472  return resultobj;
12473 fail:
12474  return NULL;
12475 }
12476 
12477 
12478 SWIGINTERN PyObject *_wrap_GenHammingComputerM8_hamming(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12479  PyObject *resultobj = 0;
12481  uint8_t *arg2 = (uint8_t *) 0 ;
12482  void *argp1 = 0 ;
12483  int res1 = 0 ;
12484  void *argp2 = 0 ;
12485  int res2 = 0 ;
12486  PyObject * obj0 = 0 ;
12487  PyObject * obj1 = 0 ;
12488  int result;
12489 
12490  if (!PyArg_ParseTuple(args,(char *)"OO:GenHammingComputerM8_hamming",&obj0,&obj1)) SWIG_fail;
12491  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, 0 | 0 );
12492  if (!SWIG_IsOK(res1)) {
12493  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GenHammingComputerM8_hamming" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 const *""'");
12494  }
12495  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12496  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
12497  if (!SWIG_IsOK(res2)) {
12498  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GenHammingComputerM8_hamming" "', argument " "2"" of type '" "uint8_t const *""'");
12499  }
12500  arg2 = reinterpret_cast< uint8_t * >(argp2);
12501  {
12502  Py_BEGIN_ALLOW_THREADS
12503  try {
12504  result = (int)((faiss::GenHammingComputerM8 const *)arg1)->hamming((uint8_t const *)arg2);
12505  } catch(faiss::FaissException & e) {
12506  PyEval_RestoreThread(_save);
12507 
12508  if (PyErr_Occurred()) {
12509  // some previous code already set the error type.
12510  } else {
12511  PyErr_SetString(PyExc_RuntimeError, e.what());
12512  }
12513  SWIG_fail;
12514  }
12515  Py_END_ALLOW_THREADS
12516  }
12517  resultobj = SWIG_From_int(static_cast< int >(result));
12518  return resultobj;
12519 fail:
12520  return NULL;
12521 }
12522 
12523 
12524 SWIGINTERN PyObject *_wrap_delete_GenHammingComputerM8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12525  PyObject *resultobj = 0;
12527  void *argp1 = 0 ;
12528  int res1 = 0 ;
12529  PyObject * obj0 = 0 ;
12530 
12531  if (!PyArg_ParseTuple(args,(char *)"O:delete_GenHammingComputerM8",&obj0)) SWIG_fail;
12532  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_POINTER_DISOWN | 0 );
12533  if (!SWIG_IsOK(res1)) {
12534  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GenHammingComputerM8" "', argument " "1"" of type '" "faiss::GenHammingComputerM8 *""'");
12535  }
12536  arg1 = reinterpret_cast< faiss::GenHammingComputerM8 * >(argp1);
12537  delete arg1;
12538  resultobj = SWIG_Py_Void();
12539  return resultobj;
12540 fail:
12541  return NULL;
12542 }
12543 
12544 
12545 SWIGINTERN PyObject *GenHammingComputerM8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12546  PyObject *obj;
12547  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
12548  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__GenHammingComputerM8, SWIG_NewClientData(obj));
12549  return SWIG_Py_Void();
12550 }
12551 
12552 SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12553  PyObject *resultobj = 0;
12555  uint8_t *arg2 = (uint8_t *) 0 ;
12556  uint8_t *arg3 = (uint8_t *) 0 ;
12557  size_t arg4 ;
12558  size_t arg5 ;
12559  int arg6 ;
12560  void *argp1 = 0 ;
12561  int res1 = 0 ;
12562  void *argp2 = 0 ;
12563  int res2 = 0 ;
12564  void *argp3 = 0 ;
12565  int res3 = 0 ;
12566  size_t val4 ;
12567  int ecode4 = 0 ;
12568  size_t val5 ;
12569  int ecode5 = 0 ;
12570  int val6 ;
12571  int ecode6 = 0 ;
12572  PyObject * obj0 = 0 ;
12573  PyObject * obj1 = 0 ;
12574  PyObject * obj2 = 0 ;
12575  PyObject * obj3 = 0 ;
12576  PyObject * obj4 = 0 ;
12577  PyObject * obj5 = 0 ;
12578 
12579  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
12580  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 );
12581  if (!SWIG_IsOK(res1)) {
12582  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'");
12583  }
12584  arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1);
12585  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
12586  if (!SWIG_IsOK(res2)) {
12587  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'");
12588  }
12589  arg2 = reinterpret_cast< uint8_t * >(argp2);
12590  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
12591  if (!SWIG_IsOK(res3)) {
12592  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'");
12593  }
12594  arg3 = reinterpret_cast< uint8_t * >(argp3);
12595  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
12596  if (!SWIG_IsOK(ecode4)) {
12597  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'");
12598  }
12599  arg4 = static_cast< size_t >(val4);
12600  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
12601  if (!SWIG_IsOK(ecode5)) {
12602  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'");
12603  }
12604  arg5 = static_cast< size_t >(val5);
12605  ecode6 = SWIG_AsVal_int(obj5, &val6);
12606  if (!SWIG_IsOK(ecode6)) {
12607  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "generalized_hammings_knn_hc" "', argument " "6"" of type '" "int""'");
12608  }
12609  arg6 = static_cast< int >(val6);
12610  {
12611  Py_BEGIN_ALLOW_THREADS
12612  try {
12613  faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
12614  } catch(faiss::FaissException & e) {
12615  PyEval_RestoreThread(_save);
12616 
12617  if (PyErr_Occurred()) {
12618  // some previous code already set the error type.
12619  } else {
12620  PyErr_SetString(PyExc_RuntimeError, e.what());
12621  }
12622  SWIG_fail;
12623  }
12624  Py_END_ALLOW_THREADS
12625  }
12626  resultobj = SWIG_Py_Void();
12627  return resultobj;
12628 fail:
12629  return NULL;
12630 }
12631 
12632 
12633 SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12634  PyObject *resultobj = 0;
12636  uint8_t *arg2 = (uint8_t *) 0 ;
12637  uint8_t *arg3 = (uint8_t *) 0 ;
12638  size_t arg4 ;
12639  size_t arg5 ;
12640  void *argp1 = 0 ;
12641  int res1 = 0 ;
12642  void *argp2 = 0 ;
12643  int res2 = 0 ;
12644  void *argp3 = 0 ;
12645  int res3 = 0 ;
12646  size_t val4 ;
12647  int ecode4 = 0 ;
12648  size_t val5 ;
12649  int ecode5 = 0 ;
12650  PyObject * obj0 = 0 ;
12651  PyObject * obj1 = 0 ;
12652  PyObject * obj2 = 0 ;
12653  PyObject * obj3 = 0 ;
12654  PyObject * obj4 = 0 ;
12655 
12656  if (!PyArg_ParseTuple(args,(char *)"OOOOO:generalized_hammings_knn_hc",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
12657  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0 | 0 );
12658  if (!SWIG_IsOK(res1)) {
12659  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "generalized_hammings_knn_hc" "', argument " "1"" of type '" "faiss::int_maxheap_array_t *""'");
12660  }
12661  arg1 = reinterpret_cast< faiss::int_maxheap_array_t * >(argp1);
12662  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
12663  if (!SWIG_IsOK(res2)) {
12664  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "generalized_hammings_knn_hc" "', argument " "2"" of type '" "uint8_t const *""'");
12665  }
12666  arg2 = reinterpret_cast< uint8_t * >(argp2);
12667  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
12668  if (!SWIG_IsOK(res3)) {
12669  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "generalized_hammings_knn_hc" "', argument " "3"" of type '" "uint8_t const *""'");
12670  }
12671  arg3 = reinterpret_cast< uint8_t * >(argp3);
12672  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
12673  if (!SWIG_IsOK(ecode4)) {
12674  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "generalized_hammings_knn_hc" "', argument " "4"" of type '" "size_t""'");
12675  }
12676  arg4 = static_cast< size_t >(val4);
12677  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
12678  if (!SWIG_IsOK(ecode5)) {
12679  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "generalized_hammings_knn_hc" "', argument " "5"" of type '" "size_t""'");
12680  }
12681  arg5 = static_cast< size_t >(val5);
12682  {
12683  Py_BEGIN_ALLOW_THREADS
12684  try {
12685  faiss::generalized_hammings_knn_hc(arg1,(unsigned char const *)arg2,(unsigned char const *)arg3,arg4,arg5);
12686  } catch(faiss::FaissException & e) {
12687  PyEval_RestoreThread(_save);
12688 
12689  if (PyErr_Occurred()) {
12690  // some previous code already set the error type.
12691  } else {
12692  PyErr_SetString(PyExc_RuntimeError, e.what());
12693  }
12694  SWIG_fail;
12695  }
12696  Py_END_ALLOW_THREADS
12697  }
12698  resultobj = SWIG_Py_Void();
12699  return resultobj;
12700 fail:
12701  return NULL;
12702 }
12703 
12704 
12705 SWIGINTERN PyObject *_wrap_generalized_hammings_knn_hc(PyObject *self, PyObject *args) {
12706  Py_ssize_t argc;
12707  PyObject *argv[7] = {
12708  0
12709  };
12710  Py_ssize_t ii;
12711 
12712  if (!PyTuple_Check(args)) SWIG_fail;
12713  argc = args ? PyObject_Length(args) : 0;
12714  for (ii = 0; (ii < 6) && (ii < argc); ii++) {
12715  argv[ii] = PyTuple_GET_ITEM(args,ii);
12716  }
12717  if (argc == 5) {
12718  int _v;
12719  void *vptr = 0;
12720  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0);
12721  _v = SWIG_CheckState(res);
12722  if (_v) {
12723  void *vptr = 0;
12724  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
12725  _v = SWIG_CheckState(res);
12726  if (_v) {
12727  void *vptr = 0;
12728  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0);
12729  _v = SWIG_CheckState(res);
12730  if (_v) {
12731  {
12732  int res = SWIG_AsVal_size_t(argv[3], NULL);
12733  _v = SWIG_CheckState(res);
12734  }
12735  if (_v) {
12736  {
12737  int res = SWIG_AsVal_size_t(argv[4], NULL);
12738  _v = SWIG_CheckState(res);
12739  }
12740  if (_v) {
12741  return _wrap_generalized_hammings_knn_hc__SWIG_1(self, args);
12742  }
12743  }
12744  }
12745  }
12746  }
12747  }
12748  if (argc == 6) {
12749  int _v;
12750  void *vptr = 0;
12751  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_int_long_t_t, 0);
12752  _v = SWIG_CheckState(res);
12753  if (_v) {
12754  void *vptr = 0;
12755  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
12756  _v = SWIG_CheckState(res);
12757  if (_v) {
12758  void *vptr = 0;
12759  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_unsigned_char, 0);
12760  _v = SWIG_CheckState(res);
12761  if (_v) {
12762  {
12763  int res = SWIG_AsVal_size_t(argv[3], NULL);
12764  _v = SWIG_CheckState(res);
12765  }
12766  if (_v) {
12767  {
12768  int res = SWIG_AsVal_size_t(argv[4], NULL);
12769  _v = SWIG_CheckState(res);
12770  }
12771  if (_v) {
12772  {
12773  int res = SWIG_AsVal_int(argv[5], NULL);
12774  _v = SWIG_CheckState(res);
12775  }
12776  if (_v) {
12777  return _wrap_generalized_hammings_knn_hc__SWIG_0(self, args);
12778  }
12779  }
12780  }
12781  }
12782  }
12783  }
12784  }
12785 
12786 fail:
12787  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'generalized_hammings_knn_hc'.\n"
12788  " Possible C/C++ prototypes are:\n"
12789  " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t,int)\n"
12790  " faiss::generalized_hammings_knn_hc(faiss::int_maxheap_array_t *,uint8_t const *,uint8_t const *,size_t,size_t)\n");
12791  return 0;
12792 }
12793 
12794 
12795 SWIGINTERN PyObject *_wrap_get_num_gpus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12796  PyObject *resultobj = 0;
12797  int result;
12798 
12799  if (!PyArg_ParseTuple(args,(char *)":get_num_gpus")) SWIG_fail;
12800  {
12801  Py_BEGIN_ALLOW_THREADS
12802  try {
12803  result = (int)get_num_gpus();
12804  } catch(faiss::FaissException & e) {
12805  PyEval_RestoreThread(_save);
12806 
12807  if (PyErr_Occurred()) {
12808  // some previous code already set the error type.
12809  } else {
12810  PyErr_SetString(PyExc_RuntimeError, e.what());
12811  }
12812  SWIG_fail;
12813  }
12814  Py_END_ALLOW_THREADS
12815  }
12816  resultobj = SWIG_From_int(static_cast< int >(result));
12817  return resultobj;
12818 fail:
12819  return NULL;
12820 }
12821 
12822 
12823 SWIGINTERN PyObject *_wrap_getmillisecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12824  PyObject *resultobj = 0;
12825  double result;
12826 
12827  if (!PyArg_ParseTuple(args,(char *)":getmillisecs")) SWIG_fail;
12828  {
12829  Py_BEGIN_ALLOW_THREADS
12830  try {
12831  result = (double)faiss::getmillisecs();
12832  } catch(faiss::FaissException & e) {
12833  PyEval_RestoreThread(_save);
12834 
12835  if (PyErr_Occurred()) {
12836  // some previous code already set the error type.
12837  } else {
12838  PyErr_SetString(PyExc_RuntimeError, e.what());
12839  }
12840  SWIG_fail;
12841  }
12842  Py_END_ALLOW_THREADS
12843  }
12844  resultobj = SWIG_From_double(static_cast< double >(result));
12845  return resultobj;
12846 fail:
12847  return NULL;
12848 }
12849 
12850 
12851 SWIGINTERN PyObject *_wrap_get_mem_usage_kb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12852  PyObject *resultobj = 0;
12853  size_t result;
12854 
12855  if (!PyArg_ParseTuple(args,(char *)":get_mem_usage_kb")) SWIG_fail;
12856  {
12857  Py_BEGIN_ALLOW_THREADS
12858  try {
12859  result = (size_t)faiss::get_mem_usage_kb();
12860  } catch(faiss::FaissException & e) {
12861  PyEval_RestoreThread(_save);
12862 
12863  if (PyErr_Occurred()) {
12864  // some previous code already set the error type.
12865  } else {
12866  PyErr_SetString(PyExc_RuntimeError, e.what());
12867  }
12868  SWIG_fail;
12869  }
12870  Py_END_ALLOW_THREADS
12871  }
12872  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
12873  return resultobj;
12874 fail:
12875  return NULL;
12876 }
12877 
12878 
12879 SWIGINTERN PyObject *_wrap_RandomGenerator_mt_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12880  PyObject *resultobj = 0;
12882  std::mt19937 arg2 ;
12883  void *argp1 = 0 ;
12884  int res1 = 0 ;
12885  void *argp2 ;
12886  int res2 = 0 ;
12887  PyObject * obj0 = 0 ;
12888  PyObject * obj1 = 0 ;
12889 
12890  if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_mt_set",&obj0,&obj1)) SWIG_fail;
12891  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
12892  if (!SWIG_IsOK(res1)) {
12893  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_set" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
12894  }
12895  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
12896  {
12897  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mt19937, 0 | 0);
12898  if (!SWIG_IsOK(res2)) {
12899  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'");
12900  }
12901  if (!argp2) {
12902  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "RandomGenerator_mt_set" "', argument " "2"" of type '" "std::mt19937""'");
12903  } else {
12904  std::mt19937 * temp = reinterpret_cast< std::mt19937 * >(argp2);
12905  arg2 = *temp;
12906  if (SWIG_IsNewObj(res2)) delete temp;
12907  }
12908  }
12909  if (arg1) (arg1)->mt = arg2;
12910  resultobj = SWIG_Py_Void();
12911  return resultobj;
12912 fail:
12913  return NULL;
12914 }
12915 
12916 
12917 SWIGINTERN PyObject *_wrap_RandomGenerator_mt_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12918  PyObject *resultobj = 0;
12920  void *argp1 = 0 ;
12921  int res1 = 0 ;
12922  PyObject * obj0 = 0 ;
12923  std::mt19937 result;
12924 
12925  if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_mt_get",&obj0)) SWIG_fail;
12926  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
12927  if (!SWIG_IsOK(res1)) {
12928  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_mt_get" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
12929  }
12930  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
12931  result = ((arg1)->mt);
12932  resultobj = SWIG_NewPointerObj((new std::mt19937(static_cast< const std::mt19937& >(result))), SWIGTYPE_p_std__mt19937, SWIG_POINTER_OWN | 0 );
12933  return resultobj;
12934 fail:
12935  return NULL;
12936 }
12937 
12938 
12939 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12940  PyObject *resultobj = 0;
12942  void *argp1 = 0 ;
12943  int res1 = 0 ;
12944  PyObject * obj0 = 0 ;
12945  int result;
12946 
12947  if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_int",&obj0)) SWIG_fail;
12948  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
12949  if (!SWIG_IsOK(res1)) {
12950  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
12951  }
12952  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
12953  {
12954  Py_BEGIN_ALLOW_THREADS
12955  try {
12956  result = (int)(arg1)->rand_int();
12957  } catch(faiss::FaissException & e) {
12958  PyEval_RestoreThread(_save);
12959 
12960  if (PyErr_Occurred()) {
12961  // some previous code already set the error type.
12962  } else {
12963  PyErr_SetString(PyExc_RuntimeError, e.what());
12964  }
12965  SWIG_fail;
12966  }
12967  Py_END_ALLOW_THREADS
12968  }
12969  resultobj = SWIG_From_int(static_cast< int >(result));
12970  return resultobj;
12971 fail:
12972  return NULL;
12973 }
12974 
12975 
12976 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_long(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12977  PyObject *resultobj = 0;
12979  void *argp1 = 0 ;
12980  int res1 = 0 ;
12981  PyObject * obj0 = 0 ;
12982  long result;
12983 
12984  if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_long",&obj0)) SWIG_fail;
12985  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
12986  if (!SWIG_IsOK(res1)) {
12987  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_long" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
12988  }
12989  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
12990  {
12991  Py_BEGIN_ALLOW_THREADS
12992  try {
12993  result = (long)(arg1)->rand_long();
12994  } catch(faiss::FaissException & e) {
12995  PyEval_RestoreThread(_save);
12996 
12997  if (PyErr_Occurred()) {
12998  // some previous code already set the error type.
12999  } else {
13000  PyErr_SetString(PyExc_RuntimeError, e.what());
13001  }
13002  SWIG_fail;
13003  }
13004  Py_END_ALLOW_THREADS
13005  }
13006  resultobj = SWIG_From_long(static_cast< long >(result));
13007  return resultobj;
13008 fail:
13009  return NULL;
13010 }
13011 
13012 
13013 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13014  PyObject *resultobj = 0;
13016  int arg2 ;
13017  void *argp1 = 0 ;
13018  int res1 = 0 ;
13019  int val2 ;
13020  int ecode2 = 0 ;
13021  PyObject * obj0 = 0 ;
13022  PyObject * obj1 = 0 ;
13023  int result;
13024 
13025  if (!PyArg_ParseTuple(args,(char *)"OO:RandomGenerator_rand_int",&obj0,&obj1)) SWIG_fail;
13026  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
13027  if (!SWIG_IsOK(res1)) {
13028  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_int" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
13029  }
13030  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
13031  ecode2 = SWIG_AsVal_int(obj1, &val2);
13032  if (!SWIG_IsOK(ecode2)) {
13033  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomGenerator_rand_int" "', argument " "2"" of type '" "int""'");
13034  }
13035  arg2 = static_cast< int >(val2);
13036  {
13037  Py_BEGIN_ALLOW_THREADS
13038  try {
13039  result = (int)(arg1)->rand_int(arg2);
13040  } catch(faiss::FaissException & e) {
13041  PyEval_RestoreThread(_save);
13042 
13043  if (PyErr_Occurred()) {
13044  // some previous code already set the error type.
13045  } else {
13046  PyErr_SetString(PyExc_RuntimeError, e.what());
13047  }
13048  SWIG_fail;
13049  }
13050  Py_END_ALLOW_THREADS
13051  }
13052  resultobj = SWIG_From_int(static_cast< int >(result));
13053  return resultobj;
13054 fail:
13055  return NULL;
13056 }
13057 
13058 
13059 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_int(PyObject *self, PyObject *args) {
13060  Py_ssize_t argc;
13061  PyObject *argv[3] = {
13062  0
13063  };
13064  Py_ssize_t ii;
13065 
13066  if (!PyTuple_Check(args)) SWIG_fail;
13067  argc = args ? PyObject_Length(args) : 0;
13068  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
13069  argv[ii] = PyTuple_GET_ITEM(args,ii);
13070  }
13071  if (argc == 1) {
13072  int _v;
13073  void *vptr = 0;
13074  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0);
13075  _v = SWIG_CheckState(res);
13076  if (_v) {
13077  return _wrap_RandomGenerator_rand_int__SWIG_0(self, args);
13078  }
13079  }
13080  if (argc == 2) {
13081  int _v;
13082  void *vptr = 0;
13083  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__RandomGenerator, 0);
13084  _v = SWIG_CheckState(res);
13085  if (_v) {
13086  {
13087  int res = SWIG_AsVal_int(argv[1], NULL);
13088  _v = SWIG_CheckState(res);
13089  }
13090  if (_v) {
13091  return _wrap_RandomGenerator_rand_int__SWIG_1(self, args);
13092  }
13093  }
13094  }
13095 
13096 fail:
13097  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'RandomGenerator_rand_int'.\n"
13098  " Possible C/C++ prototypes are:\n"
13099  " faiss::RandomGenerator::rand_int()\n"
13100  " faiss::RandomGenerator::rand_int(int)\n");
13101  return 0;
13102 }
13103 
13104 
13105 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13106  PyObject *resultobj = 0;
13108  void *argp1 = 0 ;
13109  int res1 = 0 ;
13110  PyObject * obj0 = 0 ;
13111  float result;
13112 
13113  if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_float",&obj0)) SWIG_fail;
13114  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
13115  if (!SWIG_IsOK(res1)) {
13116  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_float" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
13117  }
13118  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
13119  {
13120  Py_BEGIN_ALLOW_THREADS
13121  try {
13122  result = (float)(arg1)->rand_float();
13123  } catch(faiss::FaissException & e) {
13124  PyEval_RestoreThread(_save);
13125 
13126  if (PyErr_Occurred()) {
13127  // some previous code already set the error type.
13128  } else {
13129  PyErr_SetString(PyExc_RuntimeError, e.what());
13130  }
13131  SWIG_fail;
13132  }
13133  Py_END_ALLOW_THREADS
13134  }
13135  resultobj = SWIG_From_float(static_cast< float >(result));
13136  return resultobj;
13137 fail:
13138  return NULL;
13139 }
13140 
13141 
13142 SWIGINTERN PyObject *_wrap_RandomGenerator_rand_double(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13143  PyObject *resultobj = 0;
13145  void *argp1 = 0 ;
13146  int res1 = 0 ;
13147  PyObject * obj0 = 0 ;
13148  double result;
13149 
13150  if (!PyArg_ParseTuple(args,(char *)"O:RandomGenerator_rand_double",&obj0)) SWIG_fail;
13151  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, 0 | 0 );
13152  if (!SWIG_IsOK(res1)) {
13153  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomGenerator_rand_double" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
13154  }
13155  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
13156  {
13157  Py_BEGIN_ALLOW_THREADS
13158  try {
13159  result = (double)(arg1)->rand_double();
13160  } catch(faiss::FaissException & e) {
13161  PyEval_RestoreThread(_save);
13162 
13163  if (PyErr_Occurred()) {
13164  // some previous code already set the error type.
13165  } else {
13166  PyErr_SetString(PyExc_RuntimeError, e.what());
13167  }
13168  SWIG_fail;
13169  }
13170  Py_END_ALLOW_THREADS
13171  }
13172  resultobj = SWIG_From_double(static_cast< double >(result));
13173  return resultobj;
13174 fail:
13175  return NULL;
13176 }
13177 
13178 
13179 SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13180  PyObject *resultobj = 0;
13181  long arg1 ;
13182  long val1 ;
13183  int ecode1 = 0 ;
13184  PyObject * obj0 = 0 ;
13185  faiss::RandomGenerator *result = 0 ;
13186 
13187  if (!PyArg_ParseTuple(args,(char *)"O:new_RandomGenerator",&obj0)) SWIG_fail;
13188  ecode1 = SWIG_AsVal_long(obj0, &val1);
13189  if (!SWIG_IsOK(ecode1)) {
13190  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomGenerator" "', argument " "1"" of type '" "long""'");
13191  }
13192  arg1 = static_cast< long >(val1);
13193  {
13194  Py_BEGIN_ALLOW_THREADS
13195  try {
13196  result = (faiss::RandomGenerator *)new faiss::RandomGenerator(arg1);
13197  } catch(faiss::FaissException & e) {
13198  PyEval_RestoreThread(_save);
13199 
13200  if (PyErr_Occurred()) {
13201  // some previous code already set the error type.
13202  } else {
13203  PyErr_SetString(PyExc_RuntimeError, e.what());
13204  }
13205  SWIG_fail;
13206  }
13207  Py_END_ALLOW_THREADS
13208  }
13209  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 );
13210  return resultobj;
13211 fail:
13212  return NULL;
13213 }
13214 
13215 
13216 SWIGINTERN PyObject *_wrap_new_RandomGenerator__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13217  PyObject *resultobj = 0;
13218  faiss::RandomGenerator *result = 0 ;
13219 
13220  if (!PyArg_ParseTuple(args,(char *)":new_RandomGenerator")) SWIG_fail;
13221  {
13222  Py_BEGIN_ALLOW_THREADS
13223  try {
13225  } catch(faiss::FaissException & e) {
13226  PyEval_RestoreThread(_save);
13227 
13228  if (PyErr_Occurred()) {
13229  // some previous code already set the error type.
13230  } else {
13231  PyErr_SetString(PyExc_RuntimeError, e.what());
13232  }
13233  SWIG_fail;
13234  }
13235  Py_END_ALLOW_THREADS
13236  }
13237  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_NEW | 0 );
13238  return resultobj;
13239 fail:
13240  return NULL;
13241 }
13242 
13243 
13244 SWIGINTERN PyObject *_wrap_new_RandomGenerator(PyObject *self, PyObject *args) {
13245  Py_ssize_t argc;
13246  PyObject *argv[2] = {
13247  0
13248  };
13249  Py_ssize_t ii;
13250 
13251  if (!PyTuple_Check(args)) SWIG_fail;
13252  argc = args ? PyObject_Length(args) : 0;
13253  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
13254  argv[ii] = PyTuple_GET_ITEM(args,ii);
13255  }
13256  if (argc == 0) {
13257  return _wrap_new_RandomGenerator__SWIG_1(self, args);
13258  }
13259  if (argc == 1) {
13260  int _v;
13261  {
13262  int res = SWIG_AsVal_long(argv[0], NULL);
13263  _v = SWIG_CheckState(res);
13264  }
13265  if (_v) {
13266  return _wrap_new_RandomGenerator__SWIG_0(self, args);
13267  }
13268  }
13269 
13270 fail:
13271  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomGenerator'.\n"
13272  " Possible C/C++ prototypes are:\n"
13273  " faiss::RandomGenerator::RandomGenerator(long)\n"
13274  " faiss::RandomGenerator::RandomGenerator()\n");
13275  return 0;
13276 }
13277 
13278 
13279 SWIGINTERN PyObject *_wrap_delete_RandomGenerator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13280  PyObject *resultobj = 0;
13282  void *argp1 = 0 ;
13283  int res1 = 0 ;
13284  PyObject * obj0 = 0 ;
13285 
13286  if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomGenerator",&obj0)) SWIG_fail;
13287  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomGenerator, SWIG_POINTER_DISOWN | 0 );
13288  if (!SWIG_IsOK(res1)) {
13289  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomGenerator" "', argument " "1"" of type '" "faiss::RandomGenerator *""'");
13290  }
13291  arg1 = reinterpret_cast< faiss::RandomGenerator * >(argp1);
13292  delete arg1;
13293  resultobj = SWIG_Py_Void();
13294  return resultobj;
13295 fail:
13296  return NULL;
13297 }
13298 
13299 
13300 SWIGINTERN PyObject *RandomGenerator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13301  PyObject *obj;
13302  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
13303  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomGenerator, SWIG_NewClientData(obj));
13304  return SWIG_Py_Void();
13305 }
13306 
13307 SWIGINTERN PyObject *_wrap_float_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13308  PyObject *resultobj = 0;
13309  float *arg1 = (float *) 0 ;
13310  size_t arg2 ;
13311  long arg3 ;
13312  void *argp1 = 0 ;
13313  int res1 = 0 ;
13314  size_t val2 ;
13315  int ecode2 = 0 ;
13316  long val3 ;
13317  int ecode3 = 0 ;
13318  PyObject * obj0 = 0 ;
13319  PyObject * obj1 = 0 ;
13320  PyObject * obj2 = 0 ;
13321 
13322  if (!PyArg_ParseTuple(args,(char *)"OOO:float_rand",&obj0,&obj1,&obj2)) SWIG_fail;
13323  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
13324  if (!SWIG_IsOK(res1)) {
13325  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_rand" "', argument " "1"" of type '" "float *""'");
13326  }
13327  arg1 = reinterpret_cast< float * >(argp1);
13328  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
13329  if (!SWIG_IsOK(ecode2)) {
13330  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_rand" "', argument " "2"" of type '" "size_t""'");
13331  }
13332  arg2 = static_cast< size_t >(val2);
13333  ecode3 = SWIG_AsVal_long(obj2, &val3);
13334  if (!SWIG_IsOK(ecode3)) {
13335  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_rand" "', argument " "3"" of type '" "long""'");
13336  }
13337  arg3 = static_cast< long >(val3);
13338  {
13339  Py_BEGIN_ALLOW_THREADS
13340  try {
13341  faiss::float_rand(arg1,arg2,arg3);
13342  } catch(faiss::FaissException & e) {
13343  PyEval_RestoreThread(_save);
13344 
13345  if (PyErr_Occurred()) {
13346  // some previous code already set the error type.
13347  } else {
13348  PyErr_SetString(PyExc_RuntimeError, e.what());
13349  }
13350  SWIG_fail;
13351  }
13352  Py_END_ALLOW_THREADS
13353  }
13354  resultobj = SWIG_Py_Void();
13355  return resultobj;
13356 fail:
13357  return NULL;
13358 }
13359 
13360 
13361 SWIGINTERN PyObject *_wrap_float_randn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13362  PyObject *resultobj = 0;
13363  float *arg1 = (float *) 0 ;
13364  size_t arg2 ;
13365  long arg3 ;
13366  void *argp1 = 0 ;
13367  int res1 = 0 ;
13368  size_t val2 ;
13369  int ecode2 = 0 ;
13370  long val3 ;
13371  int ecode3 = 0 ;
13372  PyObject * obj0 = 0 ;
13373  PyObject * obj1 = 0 ;
13374  PyObject * obj2 = 0 ;
13375 
13376  if (!PyArg_ParseTuple(args,(char *)"OOO:float_randn",&obj0,&obj1,&obj2)) SWIG_fail;
13377  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
13378  if (!SWIG_IsOK(res1)) {
13379  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "float_randn" "', argument " "1"" of type '" "float *""'");
13380  }
13381  arg1 = reinterpret_cast< float * >(argp1);
13382  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
13383  if (!SWIG_IsOK(ecode2)) {
13384  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "float_randn" "', argument " "2"" of type '" "size_t""'");
13385  }
13386  arg2 = static_cast< size_t >(val2);
13387  ecode3 = SWIG_AsVal_long(obj2, &val3);
13388  if (!SWIG_IsOK(ecode3)) {
13389  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "float_randn" "', argument " "3"" of type '" "long""'");
13390  }
13391  arg3 = static_cast< long >(val3);
13392  {
13393  Py_BEGIN_ALLOW_THREADS
13394  try {
13395  faiss::float_randn(arg1,arg2,arg3);
13396  } catch(faiss::FaissException & e) {
13397  PyEval_RestoreThread(_save);
13398 
13399  if (PyErr_Occurred()) {
13400  // some previous code already set the error type.
13401  } else {
13402  PyErr_SetString(PyExc_RuntimeError, e.what());
13403  }
13404  SWIG_fail;
13405  }
13406  Py_END_ALLOW_THREADS
13407  }
13408  resultobj = SWIG_Py_Void();
13409  return resultobj;
13410 fail:
13411  return NULL;
13412 }
13413 
13414 
13415 SWIGINTERN PyObject *_wrap_long_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13416  PyObject *resultobj = 0;
13417  long *arg1 = (long *) 0 ;
13418  size_t arg2 ;
13419  long arg3 ;
13420  void *argp1 = 0 ;
13421  int res1 = 0 ;
13422  size_t val2 ;
13423  int ecode2 = 0 ;
13424  long val3 ;
13425  int ecode3 = 0 ;
13426  PyObject * obj0 = 0 ;
13427  PyObject * obj1 = 0 ;
13428  PyObject * obj2 = 0 ;
13429 
13430  if (!PyArg_ParseTuple(args,(char *)"OOO:long_rand",&obj0,&obj1,&obj2)) SWIG_fail;
13431  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_long, 0 | 0 );
13432  if (!SWIG_IsOK(res1)) {
13433  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "long_rand" "', argument " "1"" of type '" "long *""'");
13434  }
13435  arg1 = reinterpret_cast< long * >(argp1);
13436  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
13437  if (!SWIG_IsOK(ecode2)) {
13438  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "long_rand" "', argument " "2"" of type '" "size_t""'");
13439  }
13440  arg2 = static_cast< size_t >(val2);
13441  ecode3 = SWIG_AsVal_long(obj2, &val3);
13442  if (!SWIG_IsOK(ecode3)) {
13443  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "long_rand" "', argument " "3"" of type '" "long""'");
13444  }
13445  arg3 = static_cast< long >(val3);
13446  {
13447  Py_BEGIN_ALLOW_THREADS
13448  try {
13449  faiss::long_rand(arg1,arg2,arg3);
13450  } catch(faiss::FaissException & e) {
13451  PyEval_RestoreThread(_save);
13452 
13453  if (PyErr_Occurred()) {
13454  // some previous code already set the error type.
13455  } else {
13456  PyErr_SetString(PyExc_RuntimeError, e.what());
13457  }
13458  SWIG_fail;
13459  }
13460  Py_END_ALLOW_THREADS
13461  }
13462  resultobj = SWIG_Py_Void();
13463  return resultobj;
13464 fail:
13465  return NULL;
13466 }
13467 
13468 
13469 SWIGINTERN PyObject *_wrap_byte_rand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13470  PyObject *resultobj = 0;
13471  uint8_t *arg1 = (uint8_t *) 0 ;
13472  size_t arg2 ;
13473  long arg3 ;
13474  void *argp1 = 0 ;
13475  int res1 = 0 ;
13476  size_t val2 ;
13477  int ecode2 = 0 ;
13478  long val3 ;
13479  int ecode3 = 0 ;
13480  PyObject * obj0 = 0 ;
13481  PyObject * obj1 = 0 ;
13482  PyObject * obj2 = 0 ;
13483 
13484  if (!PyArg_ParseTuple(args,(char *)"OOO:byte_rand",&obj0,&obj1,&obj2)) SWIG_fail;
13485  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
13486  if (!SWIG_IsOK(res1)) {
13487  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "byte_rand" "', argument " "1"" of type '" "uint8_t *""'");
13488  }
13489  arg1 = reinterpret_cast< uint8_t * >(argp1);
13490  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
13491  if (!SWIG_IsOK(ecode2)) {
13492  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "byte_rand" "', argument " "2"" of type '" "size_t""'");
13493  }
13494  arg2 = static_cast< size_t >(val2);
13495  ecode3 = SWIG_AsVal_long(obj2, &val3);
13496  if (!SWIG_IsOK(ecode3)) {
13497  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "byte_rand" "', argument " "3"" of type '" "long""'");
13498  }
13499  arg3 = static_cast< long >(val3);
13500  {
13501  Py_BEGIN_ALLOW_THREADS
13502  try {
13503  faiss::byte_rand(arg1,arg2,arg3);
13504  } catch(faiss::FaissException & e) {
13505  PyEval_RestoreThread(_save);
13506 
13507  if (PyErr_Occurred()) {
13508  // some previous code already set the error type.
13509  } else {
13510  PyErr_SetString(PyExc_RuntimeError, e.what());
13511  }
13512  SWIG_fail;
13513  }
13514  Py_END_ALLOW_THREADS
13515  }
13516  resultobj = SWIG_Py_Void();
13517  return resultobj;
13518 fail:
13519  return NULL;
13520 }
13521 
13522 
13523 SWIGINTERN PyObject *_wrap_rand_perm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13524  PyObject *resultobj = 0;
13525  int *arg1 = (int *) 0 ;
13526  size_t arg2 ;
13527  long arg3 ;
13528  void *argp1 = 0 ;
13529  int res1 = 0 ;
13530  size_t val2 ;
13531  int ecode2 = 0 ;
13532  long val3 ;
13533  int ecode3 = 0 ;
13534  PyObject * obj0 = 0 ;
13535  PyObject * obj1 = 0 ;
13536  PyObject * obj2 = 0 ;
13537 
13538  if (!PyArg_ParseTuple(args,(char *)"OOO:rand_perm",&obj0,&obj1,&obj2)) SWIG_fail;
13539  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 );
13540  if (!SWIG_IsOK(res1)) {
13541  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_perm" "', argument " "1"" of type '" "int *""'");
13542  }
13543  arg1 = reinterpret_cast< int * >(argp1);
13544  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
13545  if (!SWIG_IsOK(ecode2)) {
13546  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_perm" "', argument " "2"" of type '" "size_t""'");
13547  }
13548  arg2 = static_cast< size_t >(val2);
13549  ecode3 = SWIG_AsVal_long(obj2, &val3);
13550  if (!SWIG_IsOK(ecode3)) {
13551  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rand_perm" "', argument " "3"" of type '" "long""'");
13552  }
13553  arg3 = static_cast< long >(val3);
13554  {
13555  Py_BEGIN_ALLOW_THREADS
13556  try {
13557  faiss::rand_perm(arg1,arg2,arg3);
13558  } catch(faiss::FaissException & e) {
13559  PyEval_RestoreThread(_save);
13560 
13561  if (PyErr_Occurred()) {
13562  // some previous code already set the error type.
13563  } else {
13564  PyErr_SetString(PyExc_RuntimeError, e.what());
13565  }
13566  SWIG_fail;
13567  }
13568  Py_END_ALLOW_THREADS
13569  }
13570  resultobj = SWIG_Py_Void();
13571  return resultobj;
13572 fail:
13573  return NULL;
13574 }
13575 
13576 
13577 SWIGINTERN PyObject *_wrap_fvec_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13578  PyObject *resultobj = 0;
13579  float *arg1 = (float *) 0 ;
13580  float *arg2 = (float *) 0 ;
13581  size_t arg3 ;
13582  void *argp1 = 0 ;
13583  int res1 = 0 ;
13584  void *argp2 = 0 ;
13585  int res2 = 0 ;
13586  size_t val3 ;
13587  int ecode3 = 0 ;
13588  PyObject * obj0 = 0 ;
13589  PyObject * obj1 = 0 ;
13590  PyObject * obj2 = 0 ;
13591  float result;
13592 
13593  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_L2sqr",&obj0,&obj1,&obj2)) SWIG_fail;
13594  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
13595  if (!SWIG_IsOK(res1)) {
13596  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr" "', argument " "1"" of type '" "float const *""'");
13597  }
13598  arg1 = reinterpret_cast< float * >(argp1);
13599  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
13600  if (!SWIG_IsOK(res2)) {
13601  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr" "', argument " "2"" of type '" "float const *""'");
13602  }
13603  arg2 = reinterpret_cast< float * >(argp2);
13604  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
13605  if (!SWIG_IsOK(ecode3)) {
13606  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_L2sqr" "', argument " "3"" of type '" "size_t""'");
13607  }
13608  arg3 = static_cast< size_t >(val3);
13609  {
13610  Py_BEGIN_ALLOW_THREADS
13611  try {
13612  result = (float)faiss::fvec_L2sqr((float const *)arg1,(float const *)arg2,arg3);
13613  } catch(faiss::FaissException & e) {
13614  PyEval_RestoreThread(_save);
13615 
13616  if (PyErr_Occurred()) {
13617  // some previous code already set the error type.
13618  } else {
13619  PyErr_SetString(PyExc_RuntimeError, e.what());
13620  }
13621  SWIG_fail;
13622  }
13623  Py_END_ALLOW_THREADS
13624  }
13625  resultobj = SWIG_From_float(static_cast< float >(result));
13626  return resultobj;
13627 fail:
13628  return NULL;
13629 }
13630 
13631 
13632 SWIGINTERN PyObject *_wrap_fvec_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13633  PyObject *resultobj = 0;
13634  float *arg1 = (float *) 0 ;
13635  float *arg2 = (float *) 0 ;
13636  size_t arg3 ;
13637  void *argp1 = 0 ;
13638  int res1 = 0 ;
13639  void *argp2 = 0 ;
13640  int res2 = 0 ;
13641  size_t val3 ;
13642  int ecode3 = 0 ;
13643  PyObject * obj0 = 0 ;
13644  PyObject * obj1 = 0 ;
13645  PyObject * obj2 = 0 ;
13646  float result;
13647 
13648  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_inner_product",&obj0,&obj1,&obj2)) SWIG_fail;
13649  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
13650  if (!SWIG_IsOK(res1)) {
13651  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_product" "', argument " "1"" of type '" "float const *""'");
13652  }
13653  arg1 = reinterpret_cast< float * >(argp1);
13654  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
13655  if (!SWIG_IsOK(res2)) {
13656  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_product" "', argument " "2"" of type '" "float const *""'");
13657  }
13658  arg2 = reinterpret_cast< float * >(argp2);
13659  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
13660  if (!SWIG_IsOK(ecode3)) {
13661  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_inner_product" "', argument " "3"" of type '" "size_t""'");
13662  }
13663  arg3 = static_cast< size_t >(val3);
13664  {
13665  Py_BEGIN_ALLOW_THREADS
13666  try {
13667  result = (float)faiss::fvec_inner_product((float const *)arg1,(float const *)arg2,arg3);
13668  } catch(faiss::FaissException & e) {
13669  PyEval_RestoreThread(_save);
13670 
13671  if (PyErr_Occurred()) {
13672  // some previous code already set the error type.
13673  } else {
13674  PyErr_SetString(PyExc_RuntimeError, e.what());
13675  }
13676  SWIG_fail;
13677  }
13678  Py_END_ALLOW_THREADS
13679  }
13680  resultobj = SWIG_From_float(static_cast< float >(result));
13681  return resultobj;
13682 fail:
13683  return NULL;
13684 }
13685 
13686 
13687 SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13688  PyObject *resultobj = 0;
13689  int arg1 ;
13690  int arg2 ;
13691  long *arg3 = (long *) 0 ;
13692  int val1 ;
13693  int ecode1 = 0 ;
13694  int val2 ;
13695  int ecode2 = 0 ;
13696  void *argp3 = 0 ;
13697  int res3 = 0 ;
13698  PyObject * obj0 = 0 ;
13699  PyObject * obj1 = 0 ;
13700  PyObject * obj2 = 0 ;
13701  double result;
13702 
13703  if (!PyArg_ParseTuple(args,(char *)"OOO:imbalance_factor",&obj0,&obj1,&obj2)) SWIG_fail;
13704  ecode1 = SWIG_AsVal_int(obj0, &val1);
13705  if (!SWIG_IsOK(ecode1)) {
13706  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'");
13707  }
13708  arg1 = static_cast< int >(val1);
13709  ecode2 = SWIG_AsVal_int(obj1, &val2);
13710  if (!SWIG_IsOK(ecode2)) {
13711  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int""'");
13712  }
13713  arg2 = static_cast< int >(val2);
13714  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
13715  if (!SWIG_IsOK(res3)) {
13716  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "imbalance_factor" "', argument " "3"" of type '" "long const *""'");
13717  }
13718  arg3 = reinterpret_cast< long * >(argp3);
13719  {
13720  Py_BEGIN_ALLOW_THREADS
13721  try {
13722  result = (double)faiss::imbalance_factor(arg1,arg2,(long const *)arg3);
13723  } catch(faiss::FaissException & e) {
13724  PyEval_RestoreThread(_save);
13725 
13726  if (PyErr_Occurred()) {
13727  // some previous code already set the error type.
13728  } else {
13729  PyErr_SetString(PyExc_RuntimeError, e.what());
13730  }
13731  SWIG_fail;
13732  }
13733  Py_END_ALLOW_THREADS
13734  }
13735  resultobj = SWIG_From_double(static_cast< double >(result));
13736  return resultobj;
13737 fail:
13738  return NULL;
13739 }
13740 
13741 
13742 SWIGINTERN PyObject *_wrap_imbalance_factor__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13743  PyObject *resultobj = 0;
13744  int arg1 ;
13745  int *arg2 = (int *) 0 ;
13746  int val1 ;
13747  int ecode1 = 0 ;
13748  void *argp2 = 0 ;
13749  int res2 = 0 ;
13750  PyObject * obj0 = 0 ;
13751  PyObject * obj1 = 0 ;
13752  double result;
13753 
13754  if (!PyArg_ParseTuple(args,(char *)"OO:imbalance_factor",&obj0,&obj1)) SWIG_fail;
13755  ecode1 = SWIG_AsVal_int(obj0, &val1);
13756  if (!SWIG_IsOK(ecode1)) {
13757  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "imbalance_factor" "', argument " "1"" of type '" "int""'");
13758  }
13759  arg1 = static_cast< int >(val1);
13760  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 );
13761  if (!SWIG_IsOK(res2)) {
13762  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "imbalance_factor" "', argument " "2"" of type '" "int const *""'");
13763  }
13764  arg2 = reinterpret_cast< int * >(argp2);
13765  {
13766  Py_BEGIN_ALLOW_THREADS
13767  try {
13768  result = (double)faiss::imbalance_factor(arg1,(int const *)arg2);
13769  } catch(faiss::FaissException & e) {
13770  PyEval_RestoreThread(_save);
13771 
13772  if (PyErr_Occurred()) {
13773  // some previous code already set the error type.
13774  } else {
13775  PyErr_SetString(PyExc_RuntimeError, e.what());
13776  }
13777  SWIG_fail;
13778  }
13779  Py_END_ALLOW_THREADS
13780  }
13781  resultobj = SWIG_From_double(static_cast< double >(result));
13782  return resultobj;
13783 fail:
13784  return NULL;
13785 }
13786 
13787 
13788 SWIGINTERN PyObject *_wrap_imbalance_factor(PyObject *self, PyObject *args) {
13789  Py_ssize_t argc;
13790  PyObject *argv[4] = {
13791  0
13792  };
13793  Py_ssize_t ii;
13794 
13795  if (!PyTuple_Check(args)) SWIG_fail;
13796  argc = args ? PyObject_Length(args) : 0;
13797  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
13798  argv[ii] = PyTuple_GET_ITEM(args,ii);
13799  }
13800  if (argc == 2) {
13801  int _v;
13802  {
13803  int res = SWIG_AsVal_int(argv[0], NULL);
13804  _v = SWIG_CheckState(res);
13805  }
13806  if (_v) {
13807  void *vptr = 0;
13808  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_int, 0);
13809  _v = SWIG_CheckState(res);
13810  if (_v) {
13811  return _wrap_imbalance_factor__SWIG_1(self, args);
13812  }
13813  }
13814  }
13815  if (argc == 3) {
13816  int _v;
13817  {
13818  int res = SWIG_AsVal_int(argv[0], NULL);
13819  _v = SWIG_CheckState(res);
13820  }
13821  if (_v) {
13822  {
13823  int res = SWIG_AsVal_int(argv[1], NULL);
13824  _v = SWIG_CheckState(res);
13825  }
13826  if (_v) {
13827  void *vptr = 0;
13828  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0);
13829  _v = SWIG_CheckState(res);
13830  if (_v) {
13831  return _wrap_imbalance_factor__SWIG_0(self, args);
13832  }
13833  }
13834  }
13835  }
13836 
13837 fail:
13838  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'imbalance_factor'.\n"
13839  " Possible C/C++ prototypes are:\n"
13840  " faiss::imbalance_factor(int,int,long const *)\n"
13841  " faiss::imbalance_factor(int,int const *)\n");
13842  return 0;
13843 }
13844 
13845 
13846 SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13847  PyObject *resultobj = 0;
13848  long arg1 ;
13849  long arg2 ;
13850  float *arg3 = (float *) 0 ;
13851  long arg4 ;
13852  float *arg5 = (float *) 0 ;
13853  float *arg6 = (float *) 0 ;
13854  long arg7 ;
13855  long arg8 ;
13856  long arg9 ;
13857  long val1 ;
13858  int ecode1 = 0 ;
13859  long val2 ;
13860  int ecode2 = 0 ;
13861  void *argp3 = 0 ;
13862  int res3 = 0 ;
13863  long val4 ;
13864  int ecode4 = 0 ;
13865  void *argp5 = 0 ;
13866  int res5 = 0 ;
13867  void *argp6 = 0 ;
13868  int res6 = 0 ;
13869  long val7 ;
13870  int ecode7 = 0 ;
13871  long val8 ;
13872  int ecode8 = 0 ;
13873  long val9 ;
13874  int ecode9 = 0 ;
13875  PyObject * obj0 = 0 ;
13876  PyObject * obj1 = 0 ;
13877  PyObject * obj2 = 0 ;
13878  PyObject * obj3 = 0 ;
13879  PyObject * obj4 = 0 ;
13880  PyObject * obj5 = 0 ;
13881  PyObject * obj6 = 0 ;
13882  PyObject * obj7 = 0 ;
13883  PyObject * obj8 = 0 ;
13884 
13885  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
13886  ecode1 = SWIG_AsVal_long(obj0, &val1);
13887  if (!SWIG_IsOK(ecode1)) {
13888  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'");
13889  }
13890  arg1 = static_cast< long >(val1);
13891  ecode2 = SWIG_AsVal_long(obj1, &val2);
13892  if (!SWIG_IsOK(ecode2)) {
13893  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'");
13894  }
13895  arg2 = static_cast< long >(val2);
13896  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
13897  if (!SWIG_IsOK(res3)) {
13898  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'");
13899  }
13900  arg3 = reinterpret_cast< float * >(argp3);
13901  ecode4 = SWIG_AsVal_long(obj3, &val4);
13902  if (!SWIG_IsOK(ecode4)) {
13903  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'");
13904  }
13905  arg4 = static_cast< long >(val4);
13906  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
13907  if (!SWIG_IsOK(res5)) {
13908  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'");
13909  }
13910  arg5 = reinterpret_cast< float * >(argp5);
13911  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
13912  if (!SWIG_IsOK(res6)) {
13913  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'");
13914  }
13915  arg6 = reinterpret_cast< float * >(argp6);
13916  ecode7 = SWIG_AsVal_long(obj6, &val7);
13917  if (!SWIG_IsOK(ecode7)) {
13918  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'");
13919  }
13920  arg7 = static_cast< long >(val7);
13921  ecode8 = SWIG_AsVal_long(obj7, &val8);
13922  if (!SWIG_IsOK(ecode8)) {
13923  SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'");
13924  }
13925  arg8 = static_cast< long >(val8);
13926  ecode9 = SWIG_AsVal_long(obj8, &val9);
13927  if (!SWIG_IsOK(ecode9)) {
13928  SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "pairwise_L2sqr" "', argument " "9"" of type '" "long""'");
13929  }
13930  arg9 = static_cast< long >(val9);
13931  {
13932  Py_BEGIN_ALLOW_THREADS
13933  try {
13934  faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8,arg9);
13935  } catch(faiss::FaissException & e) {
13936  PyEval_RestoreThread(_save);
13937 
13938  if (PyErr_Occurred()) {
13939  // some previous code already set the error type.
13940  } else {
13941  PyErr_SetString(PyExc_RuntimeError, e.what());
13942  }
13943  SWIG_fail;
13944  }
13945  Py_END_ALLOW_THREADS
13946  }
13947  resultobj = SWIG_Py_Void();
13948  return resultobj;
13949 fail:
13950  return NULL;
13951 }
13952 
13953 
13954 SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13955  PyObject *resultobj = 0;
13956  long arg1 ;
13957  long arg2 ;
13958  float *arg3 = (float *) 0 ;
13959  long arg4 ;
13960  float *arg5 = (float *) 0 ;
13961  float *arg6 = (float *) 0 ;
13962  long arg7 ;
13963  long arg8 ;
13964  long val1 ;
13965  int ecode1 = 0 ;
13966  long val2 ;
13967  int ecode2 = 0 ;
13968  void *argp3 = 0 ;
13969  int res3 = 0 ;
13970  long val4 ;
13971  int ecode4 = 0 ;
13972  void *argp5 = 0 ;
13973  int res5 = 0 ;
13974  void *argp6 = 0 ;
13975  int res6 = 0 ;
13976  long val7 ;
13977  int ecode7 = 0 ;
13978  long val8 ;
13979  int ecode8 = 0 ;
13980  PyObject * obj0 = 0 ;
13981  PyObject * obj1 = 0 ;
13982  PyObject * obj2 = 0 ;
13983  PyObject * obj3 = 0 ;
13984  PyObject * obj4 = 0 ;
13985  PyObject * obj5 = 0 ;
13986  PyObject * obj6 = 0 ;
13987  PyObject * obj7 = 0 ;
13988 
13989  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
13990  ecode1 = SWIG_AsVal_long(obj0, &val1);
13991  if (!SWIG_IsOK(ecode1)) {
13992  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'");
13993  }
13994  arg1 = static_cast< long >(val1);
13995  ecode2 = SWIG_AsVal_long(obj1, &val2);
13996  if (!SWIG_IsOK(ecode2)) {
13997  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'");
13998  }
13999  arg2 = static_cast< long >(val2);
14000  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14001  if (!SWIG_IsOK(res3)) {
14002  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'");
14003  }
14004  arg3 = reinterpret_cast< float * >(argp3);
14005  ecode4 = SWIG_AsVal_long(obj3, &val4);
14006  if (!SWIG_IsOK(ecode4)) {
14007  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'");
14008  }
14009  arg4 = static_cast< long >(val4);
14010  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
14011  if (!SWIG_IsOK(res5)) {
14012  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'");
14013  }
14014  arg5 = reinterpret_cast< float * >(argp5);
14015  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
14016  if (!SWIG_IsOK(res6)) {
14017  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'");
14018  }
14019  arg6 = reinterpret_cast< float * >(argp6);
14020  ecode7 = SWIG_AsVal_long(obj6, &val7);
14021  if (!SWIG_IsOK(ecode7)) {
14022  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'");
14023  }
14024  arg7 = static_cast< long >(val7);
14025  ecode8 = SWIG_AsVal_long(obj7, &val8);
14026  if (!SWIG_IsOK(ecode8)) {
14027  SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "pairwise_L2sqr" "', argument " "8"" of type '" "long""'");
14028  }
14029  arg8 = static_cast< long >(val8);
14030  {
14031  Py_BEGIN_ALLOW_THREADS
14032  try {
14033  faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7,arg8);
14034  } catch(faiss::FaissException & e) {
14035  PyEval_RestoreThread(_save);
14036 
14037  if (PyErr_Occurred()) {
14038  // some previous code already set the error type.
14039  } else {
14040  PyErr_SetString(PyExc_RuntimeError, e.what());
14041  }
14042  SWIG_fail;
14043  }
14044  Py_END_ALLOW_THREADS
14045  }
14046  resultobj = SWIG_Py_Void();
14047  return resultobj;
14048 fail:
14049  return NULL;
14050 }
14051 
14052 
14053 SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14054  PyObject *resultobj = 0;
14055  long arg1 ;
14056  long arg2 ;
14057  float *arg3 = (float *) 0 ;
14058  long arg4 ;
14059  float *arg5 = (float *) 0 ;
14060  float *arg6 = (float *) 0 ;
14061  long arg7 ;
14062  long val1 ;
14063  int ecode1 = 0 ;
14064  long val2 ;
14065  int ecode2 = 0 ;
14066  void *argp3 = 0 ;
14067  int res3 = 0 ;
14068  long val4 ;
14069  int ecode4 = 0 ;
14070  void *argp5 = 0 ;
14071  int res5 = 0 ;
14072  void *argp6 = 0 ;
14073  int res6 = 0 ;
14074  long val7 ;
14075  int ecode7 = 0 ;
14076  PyObject * obj0 = 0 ;
14077  PyObject * obj1 = 0 ;
14078  PyObject * obj2 = 0 ;
14079  PyObject * obj3 = 0 ;
14080  PyObject * obj4 = 0 ;
14081  PyObject * obj5 = 0 ;
14082  PyObject * obj6 = 0 ;
14083 
14084  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
14085  ecode1 = SWIG_AsVal_long(obj0, &val1);
14086  if (!SWIG_IsOK(ecode1)) {
14087  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'");
14088  }
14089  arg1 = static_cast< long >(val1);
14090  ecode2 = SWIG_AsVal_long(obj1, &val2);
14091  if (!SWIG_IsOK(ecode2)) {
14092  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'");
14093  }
14094  arg2 = static_cast< long >(val2);
14095  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14096  if (!SWIG_IsOK(res3)) {
14097  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'");
14098  }
14099  arg3 = reinterpret_cast< float * >(argp3);
14100  ecode4 = SWIG_AsVal_long(obj3, &val4);
14101  if (!SWIG_IsOK(ecode4)) {
14102  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'");
14103  }
14104  arg4 = static_cast< long >(val4);
14105  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
14106  if (!SWIG_IsOK(res5)) {
14107  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'");
14108  }
14109  arg5 = reinterpret_cast< float * >(argp5);
14110  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
14111  if (!SWIG_IsOK(res6)) {
14112  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'");
14113  }
14114  arg6 = reinterpret_cast< float * >(argp6);
14115  ecode7 = SWIG_AsVal_long(obj6, &val7);
14116  if (!SWIG_IsOK(ecode7)) {
14117  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "pairwise_L2sqr" "', argument " "7"" of type '" "long""'");
14118  }
14119  arg7 = static_cast< long >(val7);
14120  {
14121  Py_BEGIN_ALLOW_THREADS
14122  try {
14123  faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6,arg7);
14124  } catch(faiss::FaissException & e) {
14125  PyEval_RestoreThread(_save);
14126 
14127  if (PyErr_Occurred()) {
14128  // some previous code already set the error type.
14129  } else {
14130  PyErr_SetString(PyExc_RuntimeError, e.what());
14131  }
14132  SWIG_fail;
14133  }
14134  Py_END_ALLOW_THREADS
14135  }
14136  resultobj = SWIG_Py_Void();
14137  return resultobj;
14138 fail:
14139  return NULL;
14140 }
14141 
14142 
14143 SWIGINTERN PyObject *_wrap_pairwise_L2sqr__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14144  PyObject *resultobj = 0;
14145  long arg1 ;
14146  long arg2 ;
14147  float *arg3 = (float *) 0 ;
14148  long arg4 ;
14149  float *arg5 = (float *) 0 ;
14150  float *arg6 = (float *) 0 ;
14151  long val1 ;
14152  int ecode1 = 0 ;
14153  long val2 ;
14154  int ecode2 = 0 ;
14155  void *argp3 = 0 ;
14156  int res3 = 0 ;
14157  long val4 ;
14158  int ecode4 = 0 ;
14159  void *argp5 = 0 ;
14160  int res5 = 0 ;
14161  void *argp6 = 0 ;
14162  int res6 = 0 ;
14163  PyObject * obj0 = 0 ;
14164  PyObject * obj1 = 0 ;
14165  PyObject * obj2 = 0 ;
14166  PyObject * obj3 = 0 ;
14167  PyObject * obj4 = 0 ;
14168  PyObject * obj5 = 0 ;
14169 
14170  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:pairwise_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
14171  ecode1 = SWIG_AsVal_long(obj0, &val1);
14172  if (!SWIG_IsOK(ecode1)) {
14173  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pairwise_L2sqr" "', argument " "1"" of type '" "long""'");
14174  }
14175  arg1 = static_cast< long >(val1);
14176  ecode2 = SWIG_AsVal_long(obj1, &val2);
14177  if (!SWIG_IsOK(ecode2)) {
14178  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pairwise_L2sqr" "', argument " "2"" of type '" "long""'");
14179  }
14180  arg2 = static_cast< long >(val2);
14181  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14182  if (!SWIG_IsOK(res3)) {
14183  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pairwise_L2sqr" "', argument " "3"" of type '" "float const *""'");
14184  }
14185  arg3 = reinterpret_cast< float * >(argp3);
14186  ecode4 = SWIG_AsVal_long(obj3, &val4);
14187  if (!SWIG_IsOK(ecode4)) {
14188  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pairwise_L2sqr" "', argument " "4"" of type '" "long""'");
14189  }
14190  arg4 = static_cast< long >(val4);
14191  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
14192  if (!SWIG_IsOK(res5)) {
14193  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pairwise_L2sqr" "', argument " "5"" of type '" "float const *""'");
14194  }
14195  arg5 = reinterpret_cast< float * >(argp5);
14196  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
14197  if (!SWIG_IsOK(res6)) {
14198  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "pairwise_L2sqr" "', argument " "6"" of type '" "float *""'");
14199  }
14200  arg6 = reinterpret_cast< float * >(argp6);
14201  {
14202  Py_BEGIN_ALLOW_THREADS
14203  try {
14204  faiss::pairwise_L2sqr(arg1,arg2,(float const *)arg3,arg4,(float const *)arg5,arg6);
14205  } catch(faiss::FaissException & e) {
14206  PyEval_RestoreThread(_save);
14207 
14208  if (PyErr_Occurred()) {
14209  // some previous code already set the error type.
14210  } else {
14211  PyErr_SetString(PyExc_RuntimeError, e.what());
14212  }
14213  SWIG_fail;
14214  }
14215  Py_END_ALLOW_THREADS
14216  }
14217  resultobj = SWIG_Py_Void();
14218  return resultobj;
14219 fail:
14220  return NULL;
14221 }
14222 
14223 
14224 SWIGINTERN PyObject *_wrap_pairwise_L2sqr(PyObject *self, PyObject *args) {
14225  Py_ssize_t argc;
14226  PyObject *argv[10] = {
14227  0
14228  };
14229  Py_ssize_t ii;
14230 
14231  if (!PyTuple_Check(args)) SWIG_fail;
14232  argc = args ? PyObject_Length(args) : 0;
14233  for (ii = 0; (ii < 9) && (ii < argc); ii++) {
14234  argv[ii] = PyTuple_GET_ITEM(args,ii);
14235  }
14236  if (argc == 6) {
14237  int _v;
14238  {
14239  int res = SWIG_AsVal_long(argv[0], NULL);
14240  _v = SWIG_CheckState(res);
14241  }
14242  if (_v) {
14243  {
14244  int res = SWIG_AsVal_long(argv[1], NULL);
14245  _v = SWIG_CheckState(res);
14246  }
14247  if (_v) {
14248  void *vptr = 0;
14249  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
14250  _v = SWIG_CheckState(res);
14251  if (_v) {
14252  {
14253  int res = SWIG_AsVal_long(argv[3], NULL);
14254  _v = SWIG_CheckState(res);
14255  }
14256  if (_v) {
14257  void *vptr = 0;
14258  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
14259  _v = SWIG_CheckState(res);
14260  if (_v) {
14261  void *vptr = 0;
14262  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
14263  _v = SWIG_CheckState(res);
14264  if (_v) {
14265  return _wrap_pairwise_L2sqr__SWIG_3(self, args);
14266  }
14267  }
14268  }
14269  }
14270  }
14271  }
14272  }
14273  if (argc == 7) {
14274  int _v;
14275  {
14276  int res = SWIG_AsVal_long(argv[0], NULL);
14277  _v = SWIG_CheckState(res);
14278  }
14279  if (_v) {
14280  {
14281  int res = SWIG_AsVal_long(argv[1], NULL);
14282  _v = SWIG_CheckState(res);
14283  }
14284  if (_v) {
14285  void *vptr = 0;
14286  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
14287  _v = SWIG_CheckState(res);
14288  if (_v) {
14289  {
14290  int res = SWIG_AsVal_long(argv[3], NULL);
14291  _v = SWIG_CheckState(res);
14292  }
14293  if (_v) {
14294  void *vptr = 0;
14295  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
14296  _v = SWIG_CheckState(res);
14297  if (_v) {
14298  void *vptr = 0;
14299  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
14300  _v = SWIG_CheckState(res);
14301  if (_v) {
14302  {
14303  int res = SWIG_AsVal_long(argv[6], NULL);
14304  _v = SWIG_CheckState(res);
14305  }
14306  if (_v) {
14307  return _wrap_pairwise_L2sqr__SWIG_2(self, args);
14308  }
14309  }
14310  }
14311  }
14312  }
14313  }
14314  }
14315  }
14316  if (argc == 8) {
14317  int _v;
14318  {
14319  int res = SWIG_AsVal_long(argv[0], NULL);
14320  _v = SWIG_CheckState(res);
14321  }
14322  if (_v) {
14323  {
14324  int res = SWIG_AsVal_long(argv[1], NULL);
14325  _v = SWIG_CheckState(res);
14326  }
14327  if (_v) {
14328  void *vptr = 0;
14329  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
14330  _v = SWIG_CheckState(res);
14331  if (_v) {
14332  {
14333  int res = SWIG_AsVal_long(argv[3], NULL);
14334  _v = SWIG_CheckState(res);
14335  }
14336  if (_v) {
14337  void *vptr = 0;
14338  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
14339  _v = SWIG_CheckState(res);
14340  if (_v) {
14341  void *vptr = 0;
14342  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
14343  _v = SWIG_CheckState(res);
14344  if (_v) {
14345  {
14346  int res = SWIG_AsVal_long(argv[6], NULL);
14347  _v = SWIG_CheckState(res);
14348  }
14349  if (_v) {
14350  {
14351  int res = SWIG_AsVal_long(argv[7], NULL);
14352  _v = SWIG_CheckState(res);
14353  }
14354  if (_v) {
14355  return _wrap_pairwise_L2sqr__SWIG_1(self, args);
14356  }
14357  }
14358  }
14359  }
14360  }
14361  }
14362  }
14363  }
14364  }
14365  if (argc == 9) {
14366  int _v;
14367  {
14368  int res = SWIG_AsVal_long(argv[0], NULL);
14369  _v = SWIG_CheckState(res);
14370  }
14371  if (_v) {
14372  {
14373  int res = SWIG_AsVal_long(argv[1], NULL);
14374  _v = SWIG_CheckState(res);
14375  }
14376  if (_v) {
14377  void *vptr = 0;
14378  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
14379  _v = SWIG_CheckState(res);
14380  if (_v) {
14381  {
14382  int res = SWIG_AsVal_long(argv[3], NULL);
14383  _v = SWIG_CheckState(res);
14384  }
14385  if (_v) {
14386  void *vptr = 0;
14387  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_float, 0);
14388  _v = SWIG_CheckState(res);
14389  if (_v) {
14390  void *vptr = 0;
14391  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
14392  _v = SWIG_CheckState(res);
14393  if (_v) {
14394  {
14395  int res = SWIG_AsVal_long(argv[6], NULL);
14396  _v = SWIG_CheckState(res);
14397  }
14398  if (_v) {
14399  {
14400  int res = SWIG_AsVal_long(argv[7], NULL);
14401  _v = SWIG_CheckState(res);
14402  }
14403  if (_v) {
14404  {
14405  int res = SWIG_AsVal_long(argv[8], NULL);
14406  _v = SWIG_CheckState(res);
14407  }
14408  if (_v) {
14409  return _wrap_pairwise_L2sqr__SWIG_0(self, args);
14410  }
14411  }
14412  }
14413  }
14414  }
14415  }
14416  }
14417  }
14418  }
14419  }
14420 
14421 fail:
14422  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'pairwise_L2sqr'.\n"
14423  " Possible C/C++ prototypes are:\n"
14424  " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long,long)\n"
14425  " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long,long)\n"
14426  " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *,long)\n"
14427  " faiss::pairwise_L2sqr(long,long,float const *,long,float const *,float *)\n");
14428  return 0;
14429 }
14430 
14431 
14432 SWIGINTERN PyObject *_wrap_fvec_inner_products_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14433  PyObject *resultobj = 0;
14434  float *arg1 = (float *) 0 ;
14435  float *arg2 = (float *) 0 ;
14436  float *arg3 = (float *) 0 ;
14437  size_t arg4 ;
14438  size_t arg5 ;
14439  void *argp1 = 0 ;
14440  int res1 = 0 ;
14441  void *argp2 = 0 ;
14442  int res2 = 0 ;
14443  void *argp3 = 0 ;
14444  int res3 = 0 ;
14445  size_t val4 ;
14446  int ecode4 = 0 ;
14447  size_t val5 ;
14448  int ecode5 = 0 ;
14449  PyObject * obj0 = 0 ;
14450  PyObject * obj1 = 0 ;
14451  PyObject * obj2 = 0 ;
14452  PyObject * obj3 = 0 ;
14453  PyObject * obj4 = 0 ;
14454 
14455  if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_inner_products_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
14456  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14457  if (!SWIG_IsOK(res1)) {
14458  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_ny" "', argument " "1"" of type '" "float *""'");
14459  }
14460  arg1 = reinterpret_cast< float * >(argp1);
14461  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14462  if (!SWIG_IsOK(res2)) {
14463  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_ny" "', argument " "2"" of type '" "float const *""'");
14464  }
14465  arg2 = reinterpret_cast< float * >(argp2);
14466  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14467  if (!SWIG_IsOK(res3)) {
14468  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_ny" "', argument " "3"" of type '" "float const *""'");
14469  }
14470  arg3 = reinterpret_cast< float * >(argp3);
14471  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
14472  if (!SWIG_IsOK(ecode4)) {
14473  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_inner_products_ny" "', argument " "4"" of type '" "size_t""'");
14474  }
14475  arg4 = static_cast< size_t >(val4);
14476  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
14477  if (!SWIG_IsOK(ecode5)) {
14478  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_ny" "', argument " "5"" of type '" "size_t""'");
14479  }
14480  arg5 = static_cast< size_t >(val5);
14481  {
14482  Py_BEGIN_ALLOW_THREADS
14483  try {
14484  faiss::fvec_inner_products_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5);
14485  } catch(faiss::FaissException & e) {
14486  PyEval_RestoreThread(_save);
14487 
14488  if (PyErr_Occurred()) {
14489  // some previous code already set the error type.
14490  } else {
14491  PyErr_SetString(PyExc_RuntimeError, e.what());
14492  }
14493  SWIG_fail;
14494  }
14495  Py_END_ALLOW_THREADS
14496  }
14497  resultobj = SWIG_Py_Void();
14498  return resultobj;
14499 fail:
14500  return NULL;
14501 }
14502 
14503 
14504 SWIGINTERN PyObject *_wrap_fvec_L2sqr_ny(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14505  PyObject *resultobj = 0;
14506  float *arg1 = (float *) 0 ;
14507  float *arg2 = (float *) 0 ;
14508  float *arg3 = (float *) 0 ;
14509  size_t arg4 ;
14510  size_t arg5 ;
14511  void *argp1 = 0 ;
14512  int res1 = 0 ;
14513  void *argp2 = 0 ;
14514  int res2 = 0 ;
14515  void *argp3 = 0 ;
14516  int res3 = 0 ;
14517  size_t val4 ;
14518  int ecode4 = 0 ;
14519  size_t val5 ;
14520  int ecode5 = 0 ;
14521  PyObject * obj0 = 0 ;
14522  PyObject * obj1 = 0 ;
14523  PyObject * obj2 = 0 ;
14524  PyObject * obj3 = 0 ;
14525  PyObject * obj4 = 0 ;
14526 
14527  if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_L2sqr_ny",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
14528  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14529  if (!SWIG_IsOK(res1)) {
14530  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_ny" "', argument " "1"" of type '" "float *""'");
14531  }
14532  arg1 = reinterpret_cast< float * >(argp1);
14533  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14534  if (!SWIG_IsOK(res2)) {
14535  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_ny" "', argument " "2"" of type '" "float const *""'");
14536  }
14537  arg2 = reinterpret_cast< float * >(argp2);
14538  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14539  if (!SWIG_IsOK(res3)) {
14540  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_ny" "', argument " "3"" of type '" "float const *""'");
14541  }
14542  arg3 = reinterpret_cast< float * >(argp3);
14543  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
14544  if (!SWIG_IsOK(ecode4)) {
14545  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_L2sqr_ny" "', argument " "4"" of type '" "size_t""'");
14546  }
14547  arg4 = static_cast< size_t >(val4);
14548  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
14549  if (!SWIG_IsOK(ecode5)) {
14550  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_ny" "', argument " "5"" of type '" "size_t""'");
14551  }
14552  arg5 = static_cast< size_t >(val5);
14553  {
14554  Py_BEGIN_ALLOW_THREADS
14555  try {
14556  faiss::fvec_L2sqr_ny(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5);
14557  } catch(faiss::FaissException & e) {
14558  PyEval_RestoreThread(_save);
14559 
14560  if (PyErr_Occurred()) {
14561  // some previous code already set the error type.
14562  } else {
14563  PyErr_SetString(PyExc_RuntimeError, e.what());
14564  }
14565  SWIG_fail;
14566  }
14567  Py_END_ALLOW_THREADS
14568  }
14569  resultobj = SWIG_Py_Void();
14570  return resultobj;
14571 fail:
14572  return NULL;
14573 }
14574 
14575 
14576 SWIGINTERN PyObject *_wrap_fvec_norm_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14577  PyObject *resultobj = 0;
14578  float *arg1 = (float *) 0 ;
14579  size_t arg2 ;
14580  void *argp1 = 0 ;
14581  int res1 = 0 ;
14582  size_t val2 ;
14583  int ecode2 = 0 ;
14584  PyObject * obj0 = 0 ;
14585  PyObject * obj1 = 0 ;
14586  float result;
14587 
14588  if (!PyArg_ParseTuple(args,(char *)"OO:fvec_norm_L2sqr",&obj0,&obj1)) SWIG_fail;
14589  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14590  if (!SWIG_IsOK(res1)) {
14591  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norm_L2sqr" "', argument " "1"" of type '" "float const *""'");
14592  }
14593  arg1 = reinterpret_cast< float * >(argp1);
14594  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
14595  if (!SWIG_IsOK(ecode2)) {
14596  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_norm_L2sqr" "', argument " "2"" of type '" "size_t""'");
14597  }
14598  arg2 = static_cast< size_t >(val2);
14599  {
14600  Py_BEGIN_ALLOW_THREADS
14601  try {
14602  result = (float)faiss::fvec_norm_L2sqr((float const *)arg1,arg2);
14603  } catch(faiss::FaissException & e) {
14604  PyEval_RestoreThread(_save);
14605 
14606  if (PyErr_Occurred()) {
14607  // some previous code already set the error type.
14608  } else {
14609  PyErr_SetString(PyExc_RuntimeError, e.what());
14610  }
14611  SWIG_fail;
14612  }
14613  Py_END_ALLOW_THREADS
14614  }
14615  resultobj = SWIG_From_float(static_cast< float >(result));
14616  return resultobj;
14617 fail:
14618  return NULL;
14619 }
14620 
14621 
14622 SWIGINTERN PyObject *_wrap_fvec_norms_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14623  PyObject *resultobj = 0;
14624  float *arg1 = (float *) 0 ;
14625  float *arg2 = (float *) 0 ;
14626  size_t arg3 ;
14627  size_t arg4 ;
14628  void *argp1 = 0 ;
14629  int res1 = 0 ;
14630  void *argp2 = 0 ;
14631  int res2 = 0 ;
14632  size_t val3 ;
14633  int ecode3 = 0 ;
14634  size_t val4 ;
14635  int ecode4 = 0 ;
14636  PyObject * obj0 = 0 ;
14637  PyObject * obj1 = 0 ;
14638  PyObject * obj2 = 0 ;
14639  PyObject * obj3 = 0 ;
14640 
14641  if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
14642  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14643  if (!SWIG_IsOK(res1)) {
14644  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2" "', argument " "1"" of type '" "float *""'");
14645  }
14646  arg1 = reinterpret_cast< float * >(argp1);
14647  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14648  if (!SWIG_IsOK(res2)) {
14649  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2" "', argument " "2"" of type '" "float const *""'");
14650  }
14651  arg2 = reinterpret_cast< float * >(argp2);
14652  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
14653  if (!SWIG_IsOK(ecode3)) {
14654  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2" "', argument " "3"" of type '" "size_t""'");
14655  }
14656  arg3 = static_cast< size_t >(val3);
14657  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
14658  if (!SWIG_IsOK(ecode4)) {
14659  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2" "', argument " "4"" of type '" "size_t""'");
14660  }
14661  arg4 = static_cast< size_t >(val4);
14662  {
14663  Py_BEGIN_ALLOW_THREADS
14664  try {
14665  faiss::fvec_norms_L2(arg1,(float const *)arg2,arg3,arg4);
14666  } catch(faiss::FaissException & e) {
14667  PyEval_RestoreThread(_save);
14668 
14669  if (PyErr_Occurred()) {
14670  // some previous code already set the error type.
14671  } else {
14672  PyErr_SetString(PyExc_RuntimeError, e.what());
14673  }
14674  SWIG_fail;
14675  }
14676  Py_END_ALLOW_THREADS
14677  }
14678  resultobj = SWIG_Py_Void();
14679  return resultobj;
14680 fail:
14681  return NULL;
14682 }
14683 
14684 
14685 SWIGINTERN PyObject *_wrap_fvec_norms_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14686  PyObject *resultobj = 0;
14687  float *arg1 = (float *) 0 ;
14688  float *arg2 = (float *) 0 ;
14689  size_t arg3 ;
14690  size_t arg4 ;
14691  void *argp1 = 0 ;
14692  int res1 = 0 ;
14693  void *argp2 = 0 ;
14694  int res2 = 0 ;
14695  size_t val3 ;
14696  int ecode3 = 0 ;
14697  size_t val4 ;
14698  int ecode4 = 0 ;
14699  PyObject * obj0 = 0 ;
14700  PyObject * obj1 = 0 ;
14701  PyObject * obj2 = 0 ;
14702  PyObject * obj3 = 0 ;
14703 
14704  if (!PyArg_ParseTuple(args,(char *)"OOOO:fvec_norms_L2sqr",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
14705  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14706  if (!SWIG_IsOK(res1)) {
14707  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_norms_L2sqr" "', argument " "1"" of type '" "float *""'");
14708  }
14709  arg1 = reinterpret_cast< float * >(argp1);
14710  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14711  if (!SWIG_IsOK(res2)) {
14712  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_norms_L2sqr" "', argument " "2"" of type '" "float const *""'");
14713  }
14714  arg2 = reinterpret_cast< float * >(argp2);
14715  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
14716  if (!SWIG_IsOK(ecode3)) {
14717  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_norms_L2sqr" "', argument " "3"" of type '" "size_t""'");
14718  }
14719  arg3 = static_cast< size_t >(val3);
14720  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
14721  if (!SWIG_IsOK(ecode4)) {
14722  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "fvec_norms_L2sqr" "', argument " "4"" of type '" "size_t""'");
14723  }
14724  arg4 = static_cast< size_t >(val4);
14725  {
14726  Py_BEGIN_ALLOW_THREADS
14727  try {
14728  faiss::fvec_norms_L2sqr(arg1,(float const *)arg2,arg3,arg4);
14729  } catch(faiss::FaissException & e) {
14730  PyEval_RestoreThread(_save);
14731 
14732  if (PyErr_Occurred()) {
14733  // some previous code already set the error type.
14734  } else {
14735  PyErr_SetString(PyExc_RuntimeError, e.what());
14736  }
14737  SWIG_fail;
14738  }
14739  Py_END_ALLOW_THREADS
14740  }
14741  resultobj = SWIG_Py_Void();
14742  return resultobj;
14743 fail:
14744  return NULL;
14745 }
14746 
14747 
14748 SWIGINTERN PyObject *_wrap_fvec_renorm_L2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14749  PyObject *resultobj = 0;
14750  size_t arg1 ;
14751  size_t arg2 ;
14752  float *arg3 = (float *) 0 ;
14753  size_t val1 ;
14754  int ecode1 = 0 ;
14755  size_t val2 ;
14756  int ecode2 = 0 ;
14757  void *argp3 = 0 ;
14758  int res3 = 0 ;
14759  PyObject * obj0 = 0 ;
14760  PyObject * obj1 = 0 ;
14761  PyObject * obj2 = 0 ;
14762 
14763  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_renorm_L2",&obj0,&obj1,&obj2)) SWIG_fail;
14764  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
14765  if (!SWIG_IsOK(ecode1)) {
14766  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_renorm_L2" "', argument " "1"" of type '" "size_t""'");
14767  }
14768  arg1 = static_cast< size_t >(val1);
14769  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
14770  if (!SWIG_IsOK(ecode2)) {
14771  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fvec_renorm_L2" "', argument " "2"" of type '" "size_t""'");
14772  }
14773  arg2 = static_cast< size_t >(val2);
14774  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14775  if (!SWIG_IsOK(res3)) {
14776  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_renorm_L2" "', argument " "3"" of type '" "float *""'");
14777  }
14778  arg3 = reinterpret_cast< float * >(argp3);
14779  {
14780  Py_BEGIN_ALLOW_THREADS
14781  try {
14782  faiss::fvec_renorm_L2(arg1,arg2,arg3);
14783  } catch(faiss::FaissException & e) {
14784  PyEval_RestoreThread(_save);
14785 
14786  if (PyErr_Occurred()) {
14787  // some previous code already set the error type.
14788  } else {
14789  PyErr_SetString(PyExc_RuntimeError, e.what());
14790  }
14791  SWIG_fail;
14792  }
14793  Py_END_ALLOW_THREADS
14794  }
14795  resultobj = SWIG_Py_Void();
14796  return resultobj;
14797 fail:
14798  return NULL;
14799 }
14800 
14801 
14802 SWIGINTERN PyObject *_wrap_inner_product_to_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14803  PyObject *resultobj = 0;
14804  float *arg1 = (float *) 0 ;
14805  float *arg2 = (float *) 0 ;
14806  float *arg3 = (float *) 0 ;
14807  size_t arg4 ;
14808  size_t arg5 ;
14809  void *argp1 = 0 ;
14810  int res1 = 0 ;
14811  void *argp2 = 0 ;
14812  int res2 = 0 ;
14813  void *argp3 = 0 ;
14814  int res3 = 0 ;
14815  size_t val4 ;
14816  int ecode4 = 0 ;
14817  size_t val5 ;
14818  int ecode5 = 0 ;
14819  PyObject * obj0 = 0 ;
14820  PyObject * obj1 = 0 ;
14821  PyObject * obj2 = 0 ;
14822  PyObject * obj3 = 0 ;
14823  PyObject * obj4 = 0 ;
14824 
14825  if (!PyArg_ParseTuple(args,(char *)"OOOOO:inner_product_to_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
14826  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14827  if (!SWIG_IsOK(res1)) {
14828  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "inner_product_to_L2sqr" "', argument " "1"" of type '" "float *""'");
14829  }
14830  arg1 = reinterpret_cast< float * >(argp1);
14831  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14832  if (!SWIG_IsOK(res2)) {
14833  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "inner_product_to_L2sqr" "', argument " "2"" of type '" "float const *""'");
14834  }
14835  arg2 = reinterpret_cast< float * >(argp2);
14836  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14837  if (!SWIG_IsOK(res3)) {
14838  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "inner_product_to_L2sqr" "', argument " "3"" of type '" "float const *""'");
14839  }
14840  arg3 = reinterpret_cast< float * >(argp3);
14841  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
14842  if (!SWIG_IsOK(ecode4)) {
14843  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "inner_product_to_L2sqr" "', argument " "4"" of type '" "size_t""'");
14844  }
14845  arg4 = static_cast< size_t >(val4);
14846  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
14847  if (!SWIG_IsOK(ecode5)) {
14848  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "inner_product_to_L2sqr" "', argument " "5"" of type '" "size_t""'");
14849  }
14850  arg5 = static_cast< size_t >(val5);
14851  {
14852  Py_BEGIN_ALLOW_THREADS
14853  try {
14854  faiss::inner_product_to_L2sqr(arg1,(float const *)arg2,(float const *)arg3,arg4,arg5);
14855  } catch(faiss::FaissException & e) {
14856  PyEval_RestoreThread(_save);
14857 
14858  if (PyErr_Occurred()) {
14859  // some previous code already set the error type.
14860  } else {
14861  PyErr_SetString(PyExc_RuntimeError, e.what());
14862  }
14863  SWIG_fail;
14864  }
14865  Py_END_ALLOW_THREADS
14866  }
14867  resultobj = SWIG_Py_Void();
14868  return resultobj;
14869 fail:
14870  return NULL;
14871 }
14872 
14873 
14874 SWIGINTERN PyObject *_wrap_fvec_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14875  PyObject *resultobj = 0;
14876  float *arg1 = (float *) 0 ;
14877  float *arg2 = (float *) 0 ;
14878  float *arg3 = (float *) 0 ;
14879  long *arg4 = (long *) 0 ;
14880  size_t arg5 ;
14881  size_t arg6 ;
14882  size_t arg7 ;
14883  void *argp1 = 0 ;
14884  int res1 = 0 ;
14885  void *argp2 = 0 ;
14886  int res2 = 0 ;
14887  void *argp3 = 0 ;
14888  int res3 = 0 ;
14889  void *argp4 = 0 ;
14890  int res4 = 0 ;
14891  size_t val5 ;
14892  int ecode5 = 0 ;
14893  size_t val6 ;
14894  int ecode6 = 0 ;
14895  size_t val7 ;
14896  int ecode7 = 0 ;
14897  PyObject * obj0 = 0 ;
14898  PyObject * obj1 = 0 ;
14899  PyObject * obj2 = 0 ;
14900  PyObject * obj3 = 0 ;
14901  PyObject * obj4 = 0 ;
14902  PyObject * obj5 = 0 ;
14903  PyObject * obj6 = 0 ;
14904 
14905  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
14906  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14907  if (!SWIG_IsOK(res1)) {
14908  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_inner_products_by_idx" "', argument " "1"" of type '" "float *""'");
14909  }
14910  arg1 = reinterpret_cast< float * >(argp1);
14911  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
14912  if (!SWIG_IsOK(res2)) {
14913  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'");
14914  }
14915  arg2 = reinterpret_cast< float * >(argp2);
14916  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
14917  if (!SWIG_IsOK(res3)) {
14918  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_inner_products_by_idx" "', argument " "3"" of type '" "float const *""'");
14919  }
14920  arg3 = reinterpret_cast< float * >(argp3);
14921  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
14922  if (!SWIG_IsOK(res4)) {
14923  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_inner_products_by_idx" "', argument " "4"" of type '" "long const *""'");
14924  }
14925  arg4 = reinterpret_cast< long * >(argp4);
14926  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
14927  if (!SWIG_IsOK(ecode5)) {
14928  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'");
14929  }
14930  arg5 = static_cast< size_t >(val5);
14931  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
14932  if (!SWIG_IsOK(ecode6)) {
14933  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'");
14934  }
14935  arg6 = static_cast< size_t >(val6);
14936  ecode7 = SWIG_AsVal_size_t(obj6, &val7);
14937  if (!SWIG_IsOK(ecode7)) {
14938  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_inner_products_by_idx" "', argument " "7"" of type '" "size_t""'");
14939  }
14940  arg7 = static_cast< size_t >(val7);
14941  {
14942  Py_BEGIN_ALLOW_THREADS
14943  try {
14944  faiss::fvec_inner_products_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7);
14945  } catch(faiss::FaissException & e) {
14946  PyEval_RestoreThread(_save);
14947 
14948  if (PyErr_Occurred()) {
14949  // some previous code already set the error type.
14950  } else {
14951  PyErr_SetString(PyExc_RuntimeError, e.what());
14952  }
14953  SWIG_fail;
14954  }
14955  Py_END_ALLOW_THREADS
14956  }
14957  resultobj = SWIG_Py_Void();
14958  return resultobj;
14959 fail:
14960  return NULL;
14961 }
14962 
14963 
14964 SWIGINTERN PyObject *_wrap_fvec_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14965  PyObject *resultobj = 0;
14966  float *arg1 = (float *) 0 ;
14967  float *arg2 = (float *) 0 ;
14968  float *arg3 = (float *) 0 ;
14969  long *arg4 = (long *) 0 ;
14970  size_t arg5 ;
14971  size_t arg6 ;
14972  size_t arg7 ;
14973  void *argp1 = 0 ;
14974  int res1 = 0 ;
14975  void *argp2 = 0 ;
14976  int res2 = 0 ;
14977  void *argp3 = 0 ;
14978  int res3 = 0 ;
14979  void *argp4 = 0 ;
14980  int res4 = 0 ;
14981  size_t val5 ;
14982  int ecode5 = 0 ;
14983  size_t val6 ;
14984  int ecode6 = 0 ;
14985  size_t val7 ;
14986  int ecode7 = 0 ;
14987  PyObject * obj0 = 0 ;
14988  PyObject * obj1 = 0 ;
14989  PyObject * obj2 = 0 ;
14990  PyObject * obj3 = 0 ;
14991  PyObject * obj4 = 0 ;
14992  PyObject * obj5 = 0 ;
14993  PyObject * obj6 = 0 ;
14994 
14995  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:fvec_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
14996  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
14997  if (!SWIG_IsOK(res1)) {
14998  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fvec_L2sqr_by_idx" "', argument " "1"" of type '" "float *""'");
14999  }
15000  arg1 = reinterpret_cast< float * >(argp1);
15001  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15002  if (!SWIG_IsOK(res2)) {
15003  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'");
15004  }
15005  arg2 = reinterpret_cast< float * >(argp2);
15006  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
15007  if (!SWIG_IsOK(res3)) {
15008  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_L2sqr_by_idx" "', argument " "3"" of type '" "float const *""'");
15009  }
15010  arg3 = reinterpret_cast< float * >(argp3);
15011  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
15012  if (!SWIG_IsOK(res4)) {
15013  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_L2sqr_by_idx" "', argument " "4"" of type '" "long const *""'");
15014  }
15015  arg4 = reinterpret_cast< long * >(argp4);
15016  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15017  if (!SWIG_IsOK(ecode5)) {
15018  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvec_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'");
15019  }
15020  arg5 = static_cast< size_t >(val5);
15021  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
15022  if (!SWIG_IsOK(ecode6)) {
15023  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvec_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'");
15024  }
15025  arg6 = static_cast< size_t >(val6);
15026  ecode7 = SWIG_AsVal_size_t(obj6, &val7);
15027  if (!SWIG_IsOK(ecode7)) {
15028  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "fvec_L2sqr_by_idx" "', argument " "7"" of type '" "size_t""'");
15029  }
15030  arg7 = static_cast< size_t >(val7);
15031  {
15032  Py_BEGIN_ALLOW_THREADS
15033  try {
15034  faiss::fvec_L2sqr_by_idx(arg1,(float const *)arg2,(float const *)arg3,(long const *)arg4,arg5,arg6,arg7);
15035  } catch(faiss::FaissException & e) {
15036  PyEval_RestoreThread(_save);
15037 
15038  if (PyErr_Occurred()) {
15039  // some previous code already set the error type.
15040  } else {
15041  PyErr_SetString(PyExc_RuntimeError, e.what());
15042  }
15043  SWIG_fail;
15044  }
15045  Py_END_ALLOW_THREADS
15046  }
15047  resultobj = SWIG_Py_Void();
15048  return resultobj;
15049 fail:
15050  return NULL;
15051 }
15052 
15053 
15054 SWIGINTERN int Swig_var_distance_compute_blas_threshold_set(PyObject *_val) {
15055  {
15056  int val;
15057  int res = SWIG_AsVal_int(_val, &val);
15058  if (!SWIG_IsOK(res)) {
15059  SWIG_exception_fail(SWIG_ArgError(res), "in variable '""faiss::distance_compute_blas_threshold""' of type '""int""'");
15060  }
15061  faiss::distance_compute_blas_threshold = static_cast< int >(val);
15062  }
15063  return 0;
15064 fail:
15065  return 1;
15066 }
15067 
15068 
15069 SWIGINTERN PyObject *Swig_var_distance_compute_blas_threshold_get(void) {
15070  PyObject *pyobj = 0;
15071 
15072  pyobj = SWIG_From_int(static_cast< int >(faiss::distance_compute_blas_threshold));
15073  return pyobj;
15074 }
15075 
15076 
15077 SWIGINTERN PyObject *_wrap_knn_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15078  PyObject *resultobj = 0;
15079  float *arg1 = (float *) 0 ;
15080  float *arg2 = (float *) 0 ;
15081  size_t arg3 ;
15082  size_t arg4 ;
15083  size_t arg5 ;
15085  void *argp1 = 0 ;
15086  int res1 = 0 ;
15087  void *argp2 = 0 ;
15088  int res2 = 0 ;
15089  size_t val3 ;
15090  int ecode3 = 0 ;
15091  size_t val4 ;
15092  int ecode4 = 0 ;
15093  size_t val5 ;
15094  int ecode5 = 0 ;
15095  void *argp6 = 0 ;
15096  int res6 = 0 ;
15097  PyObject * obj0 = 0 ;
15098  PyObject * obj1 = 0 ;
15099  PyObject * obj2 = 0 ;
15100  PyObject * obj3 = 0 ;
15101  PyObject * obj4 = 0 ;
15102  PyObject * obj5 = 0 ;
15103 
15104  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
15105  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15106  if (!SWIG_IsOK(res1)) {
15107  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_product" "', argument " "1"" of type '" "float const *""'");
15108  }
15109  arg1 = reinterpret_cast< float * >(argp1);
15110  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15111  if (!SWIG_IsOK(res2)) {
15112  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_product" "', argument " "2"" of type '" "float const *""'");
15113  }
15114  arg2 = reinterpret_cast< float * >(argp2);
15115  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15116  if (!SWIG_IsOK(ecode3)) {
15117  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_inner_product" "', argument " "3"" of type '" "size_t""'");
15118  }
15119  arg3 = static_cast< size_t >(val3);
15120  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15121  if (!SWIG_IsOK(ecode4)) {
15122  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_product" "', argument " "4"" of type '" "size_t""'");
15123  }
15124  arg4 = static_cast< size_t >(val4);
15125  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15126  if (!SWIG_IsOK(ecode5)) {
15127  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_product" "', argument " "5"" of type '" "size_t""'");
15128  }
15129  arg5 = static_cast< size_t >(val5);
15130  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 );
15131  if (!SWIG_IsOK(res6)) {
15132  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_inner_product" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'");
15133  }
15134  arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6);
15135  {
15136  Py_BEGIN_ALLOW_THREADS
15137  try {
15138  faiss::knn_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6);
15139  } catch(faiss::FaissException & e) {
15140  PyEval_RestoreThread(_save);
15141 
15142  if (PyErr_Occurred()) {
15143  // some previous code already set the error type.
15144  } else {
15145  PyErr_SetString(PyExc_RuntimeError, e.what());
15146  }
15147  SWIG_fail;
15148  }
15149  Py_END_ALLOW_THREADS
15150  }
15151  resultobj = SWIG_Py_Void();
15152  return resultobj;
15153 fail:
15154  return NULL;
15155 }
15156 
15157 
15158 SWIGINTERN PyObject *_wrap_knn_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15159  PyObject *resultobj = 0;
15160  float *arg1 = (float *) 0 ;
15161  float *arg2 = (float *) 0 ;
15162  size_t arg3 ;
15163  size_t arg4 ;
15164  size_t arg5 ;
15166  void *argp1 = 0 ;
15167  int res1 = 0 ;
15168  void *argp2 = 0 ;
15169  int res2 = 0 ;
15170  size_t val3 ;
15171  int ecode3 = 0 ;
15172  size_t val4 ;
15173  int ecode4 = 0 ;
15174  size_t val5 ;
15175  int ecode5 = 0 ;
15176  void *argp6 = 0 ;
15177  int res6 = 0 ;
15178  PyObject * obj0 = 0 ;
15179  PyObject * obj1 = 0 ;
15180  PyObject * obj2 = 0 ;
15181  PyObject * obj3 = 0 ;
15182  PyObject * obj4 = 0 ;
15183  PyObject * obj5 = 0 ;
15184 
15185  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:knn_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
15186  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15187  if (!SWIG_IsOK(res1)) {
15188  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr" "', argument " "1"" of type '" "float const *""'");
15189  }
15190  arg1 = reinterpret_cast< float * >(argp1);
15191  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15192  if (!SWIG_IsOK(res2)) {
15193  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr" "', argument " "2"" of type '" "float const *""'");
15194  }
15195  arg2 = reinterpret_cast< float * >(argp2);
15196  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15197  if (!SWIG_IsOK(ecode3)) {
15198  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr" "', argument " "3"" of type '" "size_t""'");
15199  }
15200  arg3 = static_cast< size_t >(val3);
15201  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15202  if (!SWIG_IsOK(ecode4)) {
15203  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr" "', argument " "4"" of type '" "size_t""'");
15204  }
15205  arg4 = static_cast< size_t >(val4);
15206  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15207  if (!SWIG_IsOK(ecode5)) {
15208  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr" "', argument " "5"" of type '" "size_t""'");
15209  }
15210  arg5 = static_cast< size_t >(val5);
15211  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
15212  if (!SWIG_IsOK(res6)) {
15213  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
15214  }
15215  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
15216  {
15217  Py_BEGIN_ALLOW_THREADS
15218  try {
15219  faiss::knn_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6);
15220  } catch(faiss::FaissException & e) {
15221  PyEval_RestoreThread(_save);
15222 
15223  if (PyErr_Occurred()) {
15224  // some previous code already set the error type.
15225  } else {
15226  PyErr_SetString(PyExc_RuntimeError, e.what());
15227  }
15228  SWIG_fail;
15229  }
15230  Py_END_ALLOW_THREADS
15231  }
15232  resultobj = SWIG_Py_Void();
15233  return resultobj;
15234 fail:
15235  return NULL;
15236 }
15237 
15238 
15239 SWIGINTERN PyObject *_wrap_knn_L2sqr_base_shift(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15240  PyObject *resultobj = 0;
15241  float *arg1 = (float *) 0 ;
15242  float *arg2 = (float *) 0 ;
15243  size_t arg3 ;
15244  size_t arg4 ;
15245  size_t arg5 ;
15247  float *arg7 = (float *) 0 ;
15248  void *argp1 = 0 ;
15249  int res1 = 0 ;
15250  void *argp2 = 0 ;
15251  int res2 = 0 ;
15252  size_t val3 ;
15253  int ecode3 = 0 ;
15254  size_t val4 ;
15255  int ecode4 = 0 ;
15256  size_t val5 ;
15257  int ecode5 = 0 ;
15258  void *argp6 = 0 ;
15259  int res6 = 0 ;
15260  void *argp7 = 0 ;
15261  int res7 = 0 ;
15262  PyObject * obj0 = 0 ;
15263  PyObject * obj1 = 0 ;
15264  PyObject * obj2 = 0 ;
15265  PyObject * obj3 = 0 ;
15266  PyObject * obj4 = 0 ;
15267  PyObject * obj5 = 0 ;
15268  PyObject * obj6 = 0 ;
15269 
15270  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_base_shift",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15271  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15272  if (!SWIG_IsOK(res1)) {
15273  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_base_shift" "', argument " "1"" of type '" "float const *""'");
15274  }
15275  arg1 = reinterpret_cast< float * >(argp1);
15276  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15277  if (!SWIG_IsOK(res2)) {
15278  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_base_shift" "', argument " "2"" of type '" "float const *""'");
15279  }
15280  arg2 = reinterpret_cast< float * >(argp2);
15281  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15282  if (!SWIG_IsOK(ecode3)) {
15283  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "knn_L2sqr_base_shift" "', argument " "3"" of type '" "size_t""'");
15284  }
15285  arg3 = static_cast< size_t >(val3);
15286  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15287  if (!SWIG_IsOK(ecode4)) {
15288  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_base_shift" "', argument " "4"" of type '" "size_t""'");
15289  }
15290  arg4 = static_cast< size_t >(val4);
15291  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15292  if (!SWIG_IsOK(ecode5)) {
15293  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_base_shift" "', argument " "5"" of type '" "size_t""'");
15294  }
15295  arg5 = static_cast< size_t >(val5);
15296  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
15297  if (!SWIG_IsOK(res6)) {
15298  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "knn_L2sqr_base_shift" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
15299  }
15300  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
15301  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 );
15302  if (!SWIG_IsOK(res7)) {
15303  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_base_shift" "', argument " "7"" of type '" "float const *""'");
15304  }
15305  arg7 = reinterpret_cast< float * >(argp7);
15306  {
15307  Py_BEGIN_ALLOW_THREADS
15308  try {
15309  faiss::knn_L2sqr_base_shift((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,(float const *)arg7);
15310  } catch(faiss::FaissException & e) {
15311  PyEval_RestoreThread(_save);
15312 
15313  if (PyErr_Occurred()) {
15314  // some previous code already set the error type.
15315  } else {
15316  PyErr_SetString(PyExc_RuntimeError, e.what());
15317  }
15318  SWIG_fail;
15319  }
15320  Py_END_ALLOW_THREADS
15321  }
15322  resultobj = SWIG_Py_Void();
15323  return resultobj;
15324 fail:
15325  return NULL;
15326 }
15327 
15328 
15329 SWIGINTERN PyObject *_wrap_knn_inner_products_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15330  PyObject *resultobj = 0;
15331  float *arg1 = (float *) 0 ;
15332  float *arg2 = (float *) 0 ;
15333  long *arg3 = (long *) 0 ;
15334  size_t arg4 ;
15335  size_t arg5 ;
15336  size_t arg6 ;
15338  void *argp1 = 0 ;
15339  int res1 = 0 ;
15340  void *argp2 = 0 ;
15341  int res2 = 0 ;
15342  void *argp3 = 0 ;
15343  int res3 = 0 ;
15344  size_t val4 ;
15345  int ecode4 = 0 ;
15346  size_t val5 ;
15347  int ecode5 = 0 ;
15348  size_t val6 ;
15349  int ecode6 = 0 ;
15350  void *argp7 = 0 ;
15351  int res7 = 0 ;
15352  PyObject * obj0 = 0 ;
15353  PyObject * obj1 = 0 ;
15354  PyObject * obj2 = 0 ;
15355  PyObject * obj3 = 0 ;
15356  PyObject * obj4 = 0 ;
15357  PyObject * obj5 = 0 ;
15358  PyObject * obj6 = 0 ;
15359 
15360  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_inner_products_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15361  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15362  if (!SWIG_IsOK(res1)) {
15363  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_inner_products_by_idx" "', argument " "1"" of type '" "float const *""'");
15364  }
15365  arg1 = reinterpret_cast< float * >(argp1);
15366  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15367  if (!SWIG_IsOK(res2)) {
15368  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_inner_products_by_idx" "', argument " "2"" of type '" "float const *""'");
15369  }
15370  arg2 = reinterpret_cast< float * >(argp2);
15371  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
15372  if (!SWIG_IsOK(res3)) {
15373  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_inner_products_by_idx" "', argument " "3"" of type '" "long const *""'");
15374  }
15375  arg3 = reinterpret_cast< long * >(argp3);
15376  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15377  if (!SWIG_IsOK(ecode4)) {
15378  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_inner_products_by_idx" "', argument " "4"" of type '" "size_t""'");
15379  }
15380  arg4 = static_cast< size_t >(val4);
15381  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15382  if (!SWIG_IsOK(ecode5)) {
15383  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_inner_products_by_idx" "', argument " "5"" of type '" "size_t""'");
15384  }
15385  arg5 = static_cast< size_t >(val5);
15386  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
15387  if (!SWIG_IsOK(ecode6)) {
15388  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_inner_products_by_idx" "', argument " "6"" of type '" "size_t""'");
15389  }
15390  arg6 = static_cast< size_t >(val6);
15391  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 );
15392  if (!SWIG_IsOK(res7)) {
15393  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_inner_products_by_idx" "', argument " "7"" of type '" "faiss::float_minheap_array_t *""'");
15394  }
15395  arg7 = reinterpret_cast< faiss::float_minheap_array_t * >(argp7);
15396  {
15397  Py_BEGIN_ALLOW_THREADS
15398  try {
15399  faiss::knn_inner_products_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7);
15400  } catch(faiss::FaissException & e) {
15401  PyEval_RestoreThread(_save);
15402 
15403  if (PyErr_Occurred()) {
15404  // some previous code already set the error type.
15405  } else {
15406  PyErr_SetString(PyExc_RuntimeError, e.what());
15407  }
15408  SWIG_fail;
15409  }
15410  Py_END_ALLOW_THREADS
15411  }
15412  resultobj = SWIG_Py_Void();
15413  return resultobj;
15414 fail:
15415  return NULL;
15416 }
15417 
15418 
15419 SWIGINTERN PyObject *_wrap_knn_L2sqr_by_idx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15420  PyObject *resultobj = 0;
15421  float *arg1 = (float *) 0 ;
15422  float *arg2 = (float *) 0 ;
15423  long *arg3 = (long *) 0 ;
15424  size_t arg4 ;
15425  size_t arg5 ;
15426  size_t arg6 ;
15428  void *argp1 = 0 ;
15429  int res1 = 0 ;
15430  void *argp2 = 0 ;
15431  int res2 = 0 ;
15432  void *argp3 = 0 ;
15433  int res3 = 0 ;
15434  size_t val4 ;
15435  int ecode4 = 0 ;
15436  size_t val5 ;
15437  int ecode5 = 0 ;
15438  size_t val6 ;
15439  int ecode6 = 0 ;
15440  void *argp7 = 0 ;
15441  int res7 = 0 ;
15442  PyObject * obj0 = 0 ;
15443  PyObject * obj1 = 0 ;
15444  PyObject * obj2 = 0 ;
15445  PyObject * obj3 = 0 ;
15446  PyObject * obj4 = 0 ;
15447  PyObject * obj5 = 0 ;
15448  PyObject * obj6 = 0 ;
15449 
15450  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:knn_L2sqr_by_idx",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15451  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15452  if (!SWIG_IsOK(res1)) {
15453  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "knn_L2sqr_by_idx" "', argument " "1"" of type '" "float const *""'");
15454  }
15455  arg1 = reinterpret_cast< float * >(argp1);
15456  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15457  if (!SWIG_IsOK(res2)) {
15458  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "knn_L2sqr_by_idx" "', argument " "2"" of type '" "float const *""'");
15459  }
15460  arg2 = reinterpret_cast< float * >(argp2);
15461  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
15462  if (!SWIG_IsOK(res3)) {
15463  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "knn_L2sqr_by_idx" "', argument " "3"" of type '" "long const *""'");
15464  }
15465  arg3 = reinterpret_cast< long * >(argp3);
15466  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15467  if (!SWIG_IsOK(ecode4)) {
15468  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "knn_L2sqr_by_idx" "', argument " "4"" of type '" "size_t""'");
15469  }
15470  arg4 = static_cast< size_t >(val4);
15471  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15472  if (!SWIG_IsOK(ecode5)) {
15473  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "knn_L2sqr_by_idx" "', argument " "5"" of type '" "size_t""'");
15474  }
15475  arg5 = static_cast< size_t >(val5);
15476  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
15477  if (!SWIG_IsOK(ecode6)) {
15478  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "knn_L2sqr_by_idx" "', argument " "6"" of type '" "size_t""'");
15479  }
15480  arg6 = static_cast< size_t >(val6);
15481  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
15482  if (!SWIG_IsOK(res7)) {
15483  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "knn_L2sqr_by_idx" "', argument " "7"" of type '" "faiss::float_maxheap_array_t *""'");
15484  }
15485  arg7 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp7);
15486  {
15487  Py_BEGIN_ALLOW_THREADS
15488  try {
15489  faiss::knn_L2sqr_by_idx((float const *)arg1,(float const *)arg2,(long const *)arg3,arg4,arg5,arg6,arg7);
15490  } catch(faiss::FaissException & e) {
15491  PyEval_RestoreThread(_save);
15492 
15493  if (PyErr_Occurred()) {
15494  // some previous code already set the error type.
15495  } else {
15496  PyErr_SetString(PyExc_RuntimeError, e.what());
15497  }
15498  SWIG_fail;
15499  }
15500  Py_END_ALLOW_THREADS
15501  }
15502  resultobj = SWIG_Py_Void();
15503  return resultobj;
15504 fail:
15505  return NULL;
15506 }
15507 
15508 
15509 SWIGINTERN PyObject *_wrap_range_search_L2sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15510  PyObject *resultobj = 0;
15511  float *arg1 = (float *) 0 ;
15512  float *arg2 = (float *) 0 ;
15513  size_t arg3 ;
15514  size_t arg4 ;
15515  size_t arg5 ;
15516  float arg6 ;
15518  void *argp1 = 0 ;
15519  int res1 = 0 ;
15520  void *argp2 = 0 ;
15521  int res2 = 0 ;
15522  size_t val3 ;
15523  int ecode3 = 0 ;
15524  size_t val4 ;
15525  int ecode4 = 0 ;
15526  size_t val5 ;
15527  int ecode5 = 0 ;
15528  float val6 ;
15529  int ecode6 = 0 ;
15530  void *argp7 = 0 ;
15531  int res7 = 0 ;
15532  PyObject * obj0 = 0 ;
15533  PyObject * obj1 = 0 ;
15534  PyObject * obj2 = 0 ;
15535  PyObject * obj3 = 0 ;
15536  PyObject * obj4 = 0 ;
15537  PyObject * obj5 = 0 ;
15538  PyObject * obj6 = 0 ;
15539 
15540  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_L2sqr",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15541  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15542  if (!SWIG_IsOK(res1)) {
15543  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_L2sqr" "', argument " "1"" of type '" "float const *""'");
15544  }
15545  arg1 = reinterpret_cast< float * >(argp1);
15546  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15547  if (!SWIG_IsOK(res2)) {
15548  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_L2sqr" "', argument " "2"" of type '" "float const *""'");
15549  }
15550  arg2 = reinterpret_cast< float * >(argp2);
15551  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15552  if (!SWIG_IsOK(ecode3)) {
15553  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_L2sqr" "', argument " "3"" of type '" "size_t""'");
15554  }
15555  arg3 = static_cast< size_t >(val3);
15556  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15557  if (!SWIG_IsOK(ecode4)) {
15558  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_L2sqr" "', argument " "4"" of type '" "size_t""'");
15559  }
15560  arg4 = static_cast< size_t >(val4);
15561  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15562  if (!SWIG_IsOK(ecode5)) {
15563  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_L2sqr" "', argument " "5"" of type '" "size_t""'");
15564  }
15565  arg5 = static_cast< size_t >(val5);
15566  ecode6 = SWIG_AsVal_float(obj5, &val6);
15567  if (!SWIG_IsOK(ecode6)) {
15568  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_L2sqr" "', argument " "6"" of type '" "float""'");
15569  }
15570  arg6 = static_cast< float >(val6);
15571  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 );
15572  if (!SWIG_IsOK(res7)) {
15573  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_L2sqr" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'");
15574  }
15575  arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7);
15576  {
15577  Py_BEGIN_ALLOW_THREADS
15578  try {
15579  faiss::range_search_L2sqr((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7);
15580  } catch(faiss::FaissException & e) {
15581  PyEval_RestoreThread(_save);
15582 
15583  if (PyErr_Occurred()) {
15584  // some previous code already set the error type.
15585  } else {
15586  PyErr_SetString(PyExc_RuntimeError, e.what());
15587  }
15588  SWIG_fail;
15589  }
15590  Py_END_ALLOW_THREADS
15591  }
15592  resultobj = SWIG_Py_Void();
15593  return resultobj;
15594 fail:
15595  return NULL;
15596 }
15597 
15598 
15599 SWIGINTERN PyObject *_wrap_range_search_inner_product(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15600  PyObject *resultobj = 0;
15601  float *arg1 = (float *) 0 ;
15602  float *arg2 = (float *) 0 ;
15603  size_t arg3 ;
15604  size_t arg4 ;
15605  size_t arg5 ;
15606  float arg6 ;
15608  void *argp1 = 0 ;
15609  int res1 = 0 ;
15610  void *argp2 = 0 ;
15611  int res2 = 0 ;
15612  size_t val3 ;
15613  int ecode3 = 0 ;
15614  size_t val4 ;
15615  int ecode4 = 0 ;
15616  size_t val5 ;
15617  int ecode5 = 0 ;
15618  float val6 ;
15619  int ecode6 = 0 ;
15620  void *argp7 = 0 ;
15621  int res7 = 0 ;
15622  PyObject * obj0 = 0 ;
15623  PyObject * obj1 = 0 ;
15624  PyObject * obj2 = 0 ;
15625  PyObject * obj3 = 0 ;
15626  PyObject * obj4 = 0 ;
15627  PyObject * obj5 = 0 ;
15628  PyObject * obj6 = 0 ;
15629 
15630  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:range_search_inner_product",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15631  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15632  if (!SWIG_IsOK(res1)) {
15633  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "range_search_inner_product" "', argument " "1"" of type '" "float const *""'");
15634  }
15635  arg1 = reinterpret_cast< float * >(argp1);
15636  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15637  if (!SWIG_IsOK(res2)) {
15638  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "range_search_inner_product" "', argument " "2"" of type '" "float const *""'");
15639  }
15640  arg2 = reinterpret_cast< float * >(argp2);
15641  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15642  if (!SWIG_IsOK(ecode3)) {
15643  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "range_search_inner_product" "', argument " "3"" of type '" "size_t""'");
15644  }
15645  arg3 = static_cast< size_t >(val3);
15646  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15647  if (!SWIG_IsOK(ecode4)) {
15648  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "range_search_inner_product" "', argument " "4"" of type '" "size_t""'");
15649  }
15650  arg4 = static_cast< size_t >(val4);
15651  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15652  if (!SWIG_IsOK(ecode5)) {
15653  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "range_search_inner_product" "', argument " "5"" of type '" "size_t""'");
15654  }
15655  arg5 = static_cast< size_t >(val5);
15656  ecode6 = SWIG_AsVal_float(obj5, &val6);
15657  if (!SWIG_IsOK(ecode6)) {
15658  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "range_search_inner_product" "', argument " "6"" of type '" "float""'");
15659  }
15660  arg6 = static_cast< float >(val6);
15661  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 );
15662  if (!SWIG_IsOK(res7)) {
15663  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "range_search_inner_product" "', argument " "7"" of type '" "faiss::RangeSearchResult *""'");
15664  }
15665  arg7 = reinterpret_cast< faiss::RangeSearchResult * >(argp7);
15666  {
15667  Py_BEGIN_ALLOW_THREADS
15668  try {
15669  faiss::range_search_inner_product((float const *)arg1,(float const *)arg2,arg3,arg4,arg5,arg6,arg7);
15670  } catch(faiss::FaissException & e) {
15671  PyEval_RestoreThread(_save);
15672 
15673  if (PyErr_Occurred()) {
15674  // some previous code already set the error type.
15675  } else {
15676  PyErr_SetString(PyExc_RuntimeError, e.what());
15677  }
15678  SWIG_fail;
15679  }
15680  Py_END_ALLOW_THREADS
15681  }
15682  resultobj = SWIG_Py_Void();
15683  return resultobj;
15684 fail:
15685  return NULL;
15686 }
15687 
15688 
15689 SWIGINTERN PyObject *_wrap_fvec_madd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15690  PyObject *resultobj = 0;
15691  size_t arg1 ;
15692  float *arg2 = (float *) 0 ;
15693  float arg3 ;
15694  float *arg4 = (float *) 0 ;
15695  float *arg5 = (float *) 0 ;
15696  size_t val1 ;
15697  int ecode1 = 0 ;
15698  void *argp2 = 0 ;
15699  int res2 = 0 ;
15700  float val3 ;
15701  int ecode3 = 0 ;
15702  void *argp4 = 0 ;
15703  int res4 = 0 ;
15704  void *argp5 = 0 ;
15705  int res5 = 0 ;
15706  PyObject * obj0 = 0 ;
15707  PyObject * obj1 = 0 ;
15708  PyObject * obj2 = 0 ;
15709  PyObject * obj3 = 0 ;
15710  PyObject * obj4 = 0 ;
15711 
15712  if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
15713  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
15714  if (!SWIG_IsOK(ecode1)) {
15715  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd" "', argument " "1"" of type '" "size_t""'");
15716  }
15717  arg1 = static_cast< size_t >(val1);
15718  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15719  if (!SWIG_IsOK(res2)) {
15720  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd" "', argument " "2"" of type '" "float const *""'");
15721  }
15722  arg2 = reinterpret_cast< float * >(argp2);
15723  ecode3 = SWIG_AsVal_float(obj2, &val3);
15724  if (!SWIG_IsOK(ecode3)) {
15725  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd" "', argument " "3"" of type '" "float""'");
15726  }
15727  arg3 = static_cast< float >(val3);
15728  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
15729  if (!SWIG_IsOK(res4)) {
15730  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd" "', argument " "4"" of type '" "float const *""'");
15731  }
15732  arg4 = reinterpret_cast< float * >(argp4);
15733  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
15734  if (!SWIG_IsOK(res5)) {
15735  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd" "', argument " "5"" of type '" "float *""'");
15736  }
15737  arg5 = reinterpret_cast< float * >(argp5);
15738  {
15739  Py_BEGIN_ALLOW_THREADS
15740  try {
15741  faiss::fvec_madd(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5);
15742  } catch(faiss::FaissException & e) {
15743  PyEval_RestoreThread(_save);
15744 
15745  if (PyErr_Occurred()) {
15746  // some previous code already set the error type.
15747  } else {
15748  PyErr_SetString(PyExc_RuntimeError, e.what());
15749  }
15750  SWIG_fail;
15751  }
15752  Py_END_ALLOW_THREADS
15753  }
15754  resultobj = SWIG_Py_Void();
15755  return resultobj;
15756 fail:
15757  return NULL;
15758 }
15759 
15760 
15761 SWIGINTERN PyObject *_wrap_fvec_madd_and_argmin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15762  PyObject *resultobj = 0;
15763  size_t arg1 ;
15764  float *arg2 = (float *) 0 ;
15765  float arg3 ;
15766  float *arg4 = (float *) 0 ;
15767  float *arg5 = (float *) 0 ;
15768  size_t val1 ;
15769  int ecode1 = 0 ;
15770  void *argp2 = 0 ;
15771  int res2 = 0 ;
15772  float val3 ;
15773  int ecode3 = 0 ;
15774  void *argp4 = 0 ;
15775  int res4 = 0 ;
15776  void *argp5 = 0 ;
15777  int res5 = 0 ;
15778  PyObject * obj0 = 0 ;
15779  PyObject * obj1 = 0 ;
15780  PyObject * obj2 = 0 ;
15781  PyObject * obj3 = 0 ;
15782  PyObject * obj4 = 0 ;
15783  int result;
15784 
15785  if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvec_madd_and_argmin",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
15786  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
15787  if (!SWIG_IsOK(ecode1)) {
15788  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_madd_and_argmin" "', argument " "1"" of type '" "size_t""'");
15789  }
15790  arg1 = static_cast< size_t >(val1);
15791  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15792  if (!SWIG_IsOK(res2)) {
15793  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_madd_and_argmin" "', argument " "2"" of type '" "float const *""'");
15794  }
15795  arg2 = reinterpret_cast< float * >(argp2);
15796  ecode3 = SWIG_AsVal_float(obj2, &val3);
15797  if (!SWIG_IsOK(ecode3)) {
15798  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvec_madd_and_argmin" "', argument " "3"" of type '" "float""'");
15799  }
15800  arg3 = static_cast< float >(val3);
15801  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
15802  if (!SWIG_IsOK(res4)) {
15803  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvec_madd_and_argmin" "', argument " "4"" of type '" "float const *""'");
15804  }
15805  arg4 = reinterpret_cast< float * >(argp4);
15806  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
15807  if (!SWIG_IsOK(res5)) {
15808  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "fvec_madd_and_argmin" "', argument " "5"" of type '" "float *""'");
15809  }
15810  arg5 = reinterpret_cast< float * >(argp5);
15811  {
15812  Py_BEGIN_ALLOW_THREADS
15813  try {
15814  result = (int)faiss::fvec_madd_and_argmin(arg1,(float const *)arg2,arg3,(float const *)arg4,arg5);
15815  } catch(faiss::FaissException & e) {
15816  PyEval_RestoreThread(_save);
15817 
15818  if (PyErr_Occurred()) {
15819  // some previous code already set the error type.
15820  } else {
15821  PyErr_SetString(PyExc_RuntimeError, e.what());
15822  }
15823  SWIG_fail;
15824  }
15825  Py_END_ALLOW_THREADS
15826  }
15827  resultobj = SWIG_From_int(static_cast< int >(result));
15828  return resultobj;
15829 fail:
15830  return NULL;
15831 }
15832 
15833 
15834 SWIGINTERN PyObject *_wrap_reflection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15835  PyObject *resultobj = 0;
15836  float *arg1 = (float *) 0 ;
15837  float *arg2 = (float *) 0 ;
15838  size_t arg3 ;
15839  size_t arg4 ;
15840  size_t arg5 ;
15841  void *argp1 = 0 ;
15842  int res1 = 0 ;
15843  void *argp2 = 0 ;
15844  int res2 = 0 ;
15845  size_t val3 ;
15846  int ecode3 = 0 ;
15847  size_t val4 ;
15848  int ecode4 = 0 ;
15849  size_t val5 ;
15850  int ecode5 = 0 ;
15851  PyObject * obj0 = 0 ;
15852  PyObject * obj1 = 0 ;
15853  PyObject * obj2 = 0 ;
15854  PyObject * obj3 = 0 ;
15855  PyObject * obj4 = 0 ;
15856 
15857  if (!PyArg_ParseTuple(args,(char *)"OOOOO:reflection",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
15858  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15859  if (!SWIG_IsOK(res1)) {
15860  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "reflection" "', argument " "1"" of type '" "float const *""'");
15861  }
15862  arg1 = reinterpret_cast< float * >(argp1);
15863  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15864  if (!SWIG_IsOK(res2)) {
15865  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "reflection" "', argument " "2"" of type '" "float *""'");
15866  }
15867  arg2 = reinterpret_cast< float * >(argp2);
15868  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
15869  if (!SWIG_IsOK(ecode3)) {
15870  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "reflection" "', argument " "3"" of type '" "size_t""'");
15871  }
15872  arg3 = static_cast< size_t >(val3);
15873  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15874  if (!SWIG_IsOK(ecode4)) {
15875  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "reflection" "', argument " "4"" of type '" "size_t""'");
15876  }
15877  arg4 = static_cast< size_t >(val4);
15878  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15879  if (!SWIG_IsOK(ecode5)) {
15880  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "reflection" "', argument " "5"" of type '" "size_t""'");
15881  }
15882  arg5 = static_cast< size_t >(val5);
15883  {
15884  Py_BEGIN_ALLOW_THREADS
15885  try {
15886  faiss::reflection((float const *)arg1,arg2,arg3,arg4,arg5);
15887  } catch(faiss::FaissException & e) {
15888  PyEval_RestoreThread(_save);
15889 
15890  if (PyErr_Occurred()) {
15891  // some previous code already set the error type.
15892  } else {
15893  PyErr_SetString(PyExc_RuntimeError, e.what());
15894  }
15895  SWIG_fail;
15896  }
15897  Py_END_ALLOW_THREADS
15898  }
15899  resultobj = SWIG_Py_Void();
15900  return resultobj;
15901 fail:
15902  return NULL;
15903 }
15904 
15905 
15906 SWIGINTERN PyObject *_wrap_km_update_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15907  PyObject *resultobj = 0;
15908  float *arg1 = (float *) 0 ;
15909  float *arg2 = (float *) 0 ;
15910  long *arg3 = (long *) 0 ;
15911  size_t arg4 ;
15912  size_t arg5 ;
15913  size_t arg6 ;
15914  size_t arg7 ;
15915  void *argp1 = 0 ;
15916  int res1 = 0 ;
15917  void *argp2 = 0 ;
15918  int res2 = 0 ;
15919  void *argp3 = 0 ;
15920  int res3 = 0 ;
15921  size_t val4 ;
15922  int ecode4 = 0 ;
15923  size_t val5 ;
15924  int ecode5 = 0 ;
15925  size_t val6 ;
15926  int ecode6 = 0 ;
15927  size_t val7 ;
15928  int ecode7 = 0 ;
15929  PyObject * obj0 = 0 ;
15930  PyObject * obj1 = 0 ;
15931  PyObject * obj2 = 0 ;
15932  PyObject * obj3 = 0 ;
15933  PyObject * obj4 = 0 ;
15934  PyObject * obj5 = 0 ;
15935  PyObject * obj6 = 0 ;
15936  int result;
15937 
15938  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:km_update_centroids",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15939  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_float, 0 | 0 );
15940  if (!SWIG_IsOK(res1)) {
15941  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "km_update_centroids" "', argument " "1"" of type '" "float const *""'");
15942  }
15943  arg1 = reinterpret_cast< float * >(argp1);
15944  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
15945  if (!SWIG_IsOK(res2)) {
15946  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "km_update_centroids" "', argument " "2"" of type '" "float *""'");
15947  }
15948  arg2 = reinterpret_cast< float * >(argp2);
15949  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
15950  if (!SWIG_IsOK(res3)) {
15951  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "km_update_centroids" "', argument " "3"" of type '" "long *""'");
15952  }
15953  arg3 = reinterpret_cast< long * >(argp3);
15954  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
15955  if (!SWIG_IsOK(ecode4)) {
15956  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "km_update_centroids" "', argument " "4"" of type '" "size_t""'");
15957  }
15958  arg4 = static_cast< size_t >(val4);
15959  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
15960  if (!SWIG_IsOK(ecode5)) {
15961  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "km_update_centroids" "', argument " "5"" of type '" "size_t""'");
15962  }
15963  arg5 = static_cast< size_t >(val5);
15964  ecode6 = SWIG_AsVal_size_t(obj5, &val6);
15965  if (!SWIG_IsOK(ecode6)) {
15966  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "km_update_centroids" "', argument " "6"" of type '" "size_t""'");
15967  }
15968  arg6 = static_cast< size_t >(val6);
15969  ecode7 = SWIG_AsVal_size_t(obj6, &val7);
15970  if (!SWIG_IsOK(ecode7)) {
15971  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "km_update_centroids" "', argument " "7"" of type '" "size_t""'");
15972  }
15973  arg7 = static_cast< size_t >(val7);
15974  {
15975  Py_BEGIN_ALLOW_THREADS
15976  try {
15977  result = (int)faiss::km_update_centroids((float const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
15978  } catch(faiss::FaissException & e) {
15979  PyEval_RestoreThread(_save);
15980 
15981  if (PyErr_Occurred()) {
15982  // some previous code already set the error type.
15983  } else {
15984  PyErr_SetString(PyExc_RuntimeError, e.what());
15985  }
15986  SWIG_fail;
15987  }
15988  Py_END_ALLOW_THREADS
15989  }
15990  resultobj = SWIG_From_int(static_cast< int >(result));
15991  return resultobj;
15992 fail:
15993  return NULL;
15994 }
15995 
15996 
15997 SWIGINTERN PyObject *_wrap_matrix_qr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15998  PyObject *resultobj = 0;
15999  int arg1 ;
16000  int arg2 ;
16001  float *arg3 = (float *) 0 ;
16002  int val1 ;
16003  int ecode1 = 0 ;
16004  int val2 ;
16005  int ecode2 = 0 ;
16006  void *argp3 = 0 ;
16007  int res3 = 0 ;
16008  PyObject * obj0 = 0 ;
16009  PyObject * obj1 = 0 ;
16010  PyObject * obj2 = 0 ;
16011 
16012  if (!PyArg_ParseTuple(args,(char *)"OOO:matrix_qr",&obj0,&obj1,&obj2)) SWIG_fail;
16013  ecode1 = SWIG_AsVal_int(obj0, &val1);
16014  if (!SWIG_IsOK(ecode1)) {
16015  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "matrix_qr" "', argument " "1"" of type '" "int""'");
16016  }
16017  arg1 = static_cast< int >(val1);
16018  ecode2 = SWIG_AsVal_int(obj1, &val2);
16019  if (!SWIG_IsOK(ecode2)) {
16020  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "matrix_qr" "', argument " "2"" of type '" "int""'");
16021  }
16022  arg2 = static_cast< int >(val2);
16023  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
16024  if (!SWIG_IsOK(res3)) {
16025  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "matrix_qr" "', argument " "3"" of type '" "float *""'");
16026  }
16027  arg3 = reinterpret_cast< float * >(argp3);
16028  {
16029  Py_BEGIN_ALLOW_THREADS
16030  try {
16031  faiss::matrix_qr(arg1,arg2,arg3);
16032  } catch(faiss::FaissException & e) {
16033  PyEval_RestoreThread(_save);
16034 
16035  if (PyErr_Occurred()) {
16036  // some previous code already set the error type.
16037  } else {
16038  PyErr_SetString(PyExc_RuntimeError, e.what());
16039  }
16040  SWIG_fail;
16041  }
16042  Py_END_ALLOW_THREADS
16043  }
16044  resultobj = SWIG_Py_Void();
16045  return resultobj;
16046 fail:
16047  return NULL;
16048 }
16049 
16050 
16051 SWIGINTERN PyObject *_wrap_ranklist_handle_ties(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16052  PyObject *resultobj = 0;
16053  int arg1 ;
16054  long *arg2 = (long *) 0 ;
16055  float *arg3 = (float *) 0 ;
16056  int val1 ;
16057  int ecode1 = 0 ;
16058  void *argp2 = 0 ;
16059  int res2 = 0 ;
16060  void *argp3 = 0 ;
16061  int res3 = 0 ;
16062  PyObject * obj0 = 0 ;
16063  PyObject * obj1 = 0 ;
16064  PyObject * obj2 = 0 ;
16065 
16066  if (!PyArg_ParseTuple(args,(char *)"OOO:ranklist_handle_ties",&obj0,&obj1,&obj2)) SWIG_fail;
16067  ecode1 = SWIG_AsVal_int(obj0, &val1);
16068  if (!SWIG_IsOK(ecode1)) {
16069  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_handle_ties" "', argument " "1"" of type '" "int""'");
16070  }
16071  arg1 = static_cast< int >(val1);
16072  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 );
16073  if (!SWIG_IsOK(res2)) {
16074  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_handle_ties" "', argument " "2"" of type '" "long *""'");
16075  }
16076  arg2 = reinterpret_cast< long * >(argp2);
16077  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
16078  if (!SWIG_IsOK(res3)) {
16079  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ranklist_handle_ties" "', argument " "3"" of type '" "float const *""'");
16080  }
16081  arg3 = reinterpret_cast< float * >(argp3);
16082  {
16083  Py_BEGIN_ALLOW_THREADS
16084  try {
16085  faiss::ranklist_handle_ties(arg1,arg2,(float const *)arg3);
16086  } catch(faiss::FaissException & e) {
16087  PyEval_RestoreThread(_save);
16088 
16089  if (PyErr_Occurred()) {
16090  // some previous code already set the error type.
16091  } else {
16092  PyErr_SetString(PyExc_RuntimeError, e.what());
16093  }
16094  SWIG_fail;
16095  }
16096  Py_END_ALLOW_THREADS
16097  }
16098  resultobj = SWIG_Py_Void();
16099  return resultobj;
16100 fail:
16101  return NULL;
16102 }
16103 
16104 
16105 SWIGINTERN PyObject *_wrap_ranklist_intersection_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16106  PyObject *resultobj = 0;
16107  size_t arg1 ;
16108  long *arg2 = (long *) 0 ;
16109  size_t arg3 ;
16110  long *arg4 = (long *) 0 ;
16111  size_t val1 ;
16112  int ecode1 = 0 ;
16113  void *argp2 = 0 ;
16114  int res2 = 0 ;
16115  size_t val3 ;
16116  int ecode3 = 0 ;
16117  void *argp4 = 0 ;
16118  int res4 = 0 ;
16119  PyObject * obj0 = 0 ;
16120  PyObject * obj1 = 0 ;
16121  PyObject * obj2 = 0 ;
16122  PyObject * obj3 = 0 ;
16123  size_t result;
16124 
16125  if (!PyArg_ParseTuple(args,(char *)"OOOO:ranklist_intersection_size",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
16126  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16127  if (!SWIG_IsOK(ecode1)) {
16128  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ranklist_intersection_size" "', argument " "1"" of type '" "size_t""'");
16129  }
16130  arg1 = static_cast< size_t >(val1);
16131  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_long, 0 | 0 );
16132  if (!SWIG_IsOK(res2)) {
16133  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ranklist_intersection_size" "', argument " "2"" of type '" "long const *""'");
16134  }
16135  arg2 = reinterpret_cast< long * >(argp2);
16136  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
16137  if (!SWIG_IsOK(ecode3)) {
16138  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ranklist_intersection_size" "', argument " "3"" of type '" "size_t""'");
16139  }
16140  arg3 = static_cast< size_t >(val3);
16141  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
16142  if (!SWIG_IsOK(res4)) {
16143  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ranklist_intersection_size" "', argument " "4"" of type '" "long const *""'");
16144  }
16145  arg4 = reinterpret_cast< long * >(argp4);
16146  {
16147  Py_BEGIN_ALLOW_THREADS
16148  try {
16149  result = (size_t)faiss::ranklist_intersection_size(arg1,(long const *)arg2,arg3,(long const *)arg4);
16150  } catch(faiss::FaissException & e) {
16151  PyEval_RestoreThread(_save);
16152 
16153  if (PyErr_Occurred()) {
16154  // some previous code already set the error type.
16155  } else {
16156  PyErr_SetString(PyExc_RuntimeError, e.what());
16157  }
16158  SWIG_fail;
16159  }
16160  Py_END_ALLOW_THREADS
16161  }
16162  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
16163  return resultobj;
16164 fail:
16165  return NULL;
16166 }
16167 
16168 
16169 SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16170  PyObject *resultobj = 0;
16171  size_t arg1 ;
16172  size_t arg2 ;
16173  long *arg3 = (long *) 0 ;
16174  float *arg4 = (float *) 0 ;
16175  long *arg5 = (long *) 0 ;
16176  float *arg6 = (float *) 0 ;
16177  bool arg7 ;
16178  long arg8 ;
16179  size_t val1 ;
16180  int ecode1 = 0 ;
16181  size_t val2 ;
16182  int ecode2 = 0 ;
16183  void *argp3 = 0 ;
16184  int res3 = 0 ;
16185  void *argp4 = 0 ;
16186  int res4 = 0 ;
16187  void *argp5 = 0 ;
16188  int res5 = 0 ;
16189  void *argp6 = 0 ;
16190  int res6 = 0 ;
16191  bool val7 ;
16192  int ecode7 = 0 ;
16193  long val8 ;
16194  int ecode8 = 0 ;
16195  PyObject * obj0 = 0 ;
16196  PyObject * obj1 = 0 ;
16197  PyObject * obj2 = 0 ;
16198  PyObject * obj3 = 0 ;
16199  PyObject * obj4 = 0 ;
16200  PyObject * obj5 = 0 ;
16201  PyObject * obj6 = 0 ;
16202  PyObject * obj7 = 0 ;
16203  size_t result;
16204 
16205  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
16206  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16207  if (!SWIG_IsOK(ecode1)) {
16208  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'");
16209  }
16210  arg1 = static_cast< size_t >(val1);
16211  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
16212  if (!SWIG_IsOK(ecode2)) {
16213  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'");
16214  }
16215  arg2 = static_cast< size_t >(val2);
16216  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
16217  if (!SWIG_IsOK(res3)) {
16218  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'");
16219  }
16220  arg3 = reinterpret_cast< long * >(argp3);
16221  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
16222  if (!SWIG_IsOK(res4)) {
16223  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'");
16224  }
16225  arg4 = reinterpret_cast< float * >(argp4);
16226  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 );
16227  if (!SWIG_IsOK(res5)) {
16228  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'");
16229  }
16230  arg5 = reinterpret_cast< long * >(argp5);
16231  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
16232  if (!SWIG_IsOK(res6)) {
16233  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'");
16234  }
16235  arg6 = reinterpret_cast< float * >(argp6);
16236  ecode7 = SWIG_AsVal_bool(obj6, &val7);
16237  if (!SWIG_IsOK(ecode7)) {
16238  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'");
16239  }
16240  arg7 = static_cast< bool >(val7);
16241  ecode8 = SWIG_AsVal_long(obj7, &val8);
16242  if (!SWIG_IsOK(ecode8)) {
16243  SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "merge_result_table_with" "', argument " "8"" of type '" "long""'");
16244  }
16245  arg8 = static_cast< long >(val8);
16246  {
16247  Py_BEGIN_ALLOW_THREADS
16248  try {
16249  result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7,arg8);
16250  } catch(faiss::FaissException & e) {
16251  PyEval_RestoreThread(_save);
16252 
16253  if (PyErr_Occurred()) {
16254  // some previous code already set the error type.
16255  } else {
16256  PyErr_SetString(PyExc_RuntimeError, e.what());
16257  }
16258  SWIG_fail;
16259  }
16260  Py_END_ALLOW_THREADS
16261  }
16262  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
16263  return resultobj;
16264 fail:
16265  return NULL;
16266 }
16267 
16268 
16269 SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16270  PyObject *resultobj = 0;
16271  size_t arg1 ;
16272  size_t arg2 ;
16273  long *arg3 = (long *) 0 ;
16274  float *arg4 = (float *) 0 ;
16275  long *arg5 = (long *) 0 ;
16276  float *arg6 = (float *) 0 ;
16277  bool arg7 ;
16278  size_t val1 ;
16279  int ecode1 = 0 ;
16280  size_t val2 ;
16281  int ecode2 = 0 ;
16282  void *argp3 = 0 ;
16283  int res3 = 0 ;
16284  void *argp4 = 0 ;
16285  int res4 = 0 ;
16286  void *argp5 = 0 ;
16287  int res5 = 0 ;
16288  void *argp6 = 0 ;
16289  int res6 = 0 ;
16290  bool val7 ;
16291  int ecode7 = 0 ;
16292  PyObject * obj0 = 0 ;
16293  PyObject * obj1 = 0 ;
16294  PyObject * obj2 = 0 ;
16295  PyObject * obj3 = 0 ;
16296  PyObject * obj4 = 0 ;
16297  PyObject * obj5 = 0 ;
16298  PyObject * obj6 = 0 ;
16299  size_t result;
16300 
16301  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
16302  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16303  if (!SWIG_IsOK(ecode1)) {
16304  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'");
16305  }
16306  arg1 = static_cast< size_t >(val1);
16307  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
16308  if (!SWIG_IsOK(ecode2)) {
16309  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'");
16310  }
16311  arg2 = static_cast< size_t >(val2);
16312  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
16313  if (!SWIG_IsOK(res3)) {
16314  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'");
16315  }
16316  arg3 = reinterpret_cast< long * >(argp3);
16317  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
16318  if (!SWIG_IsOK(res4)) {
16319  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'");
16320  }
16321  arg4 = reinterpret_cast< float * >(argp4);
16322  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 );
16323  if (!SWIG_IsOK(res5)) {
16324  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'");
16325  }
16326  arg5 = reinterpret_cast< long * >(argp5);
16327  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
16328  if (!SWIG_IsOK(res6)) {
16329  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'");
16330  }
16331  arg6 = reinterpret_cast< float * >(argp6);
16332  ecode7 = SWIG_AsVal_bool(obj6, &val7);
16333  if (!SWIG_IsOK(ecode7)) {
16334  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "merge_result_table_with" "', argument " "7"" of type '" "bool""'");
16335  }
16336  arg7 = static_cast< bool >(val7);
16337  {
16338  Py_BEGIN_ALLOW_THREADS
16339  try {
16340  result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6,arg7);
16341  } catch(faiss::FaissException & e) {
16342  PyEval_RestoreThread(_save);
16343 
16344  if (PyErr_Occurred()) {
16345  // some previous code already set the error type.
16346  } else {
16347  PyErr_SetString(PyExc_RuntimeError, e.what());
16348  }
16349  SWIG_fail;
16350  }
16351  Py_END_ALLOW_THREADS
16352  }
16353  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
16354  return resultobj;
16355 fail:
16356  return NULL;
16357 }
16358 
16359 
16360 SWIGINTERN PyObject *_wrap_merge_result_table_with__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16361  PyObject *resultobj = 0;
16362  size_t arg1 ;
16363  size_t arg2 ;
16364  long *arg3 = (long *) 0 ;
16365  float *arg4 = (float *) 0 ;
16366  long *arg5 = (long *) 0 ;
16367  float *arg6 = (float *) 0 ;
16368  size_t val1 ;
16369  int ecode1 = 0 ;
16370  size_t val2 ;
16371  int ecode2 = 0 ;
16372  void *argp3 = 0 ;
16373  int res3 = 0 ;
16374  void *argp4 = 0 ;
16375  int res4 = 0 ;
16376  void *argp5 = 0 ;
16377  int res5 = 0 ;
16378  void *argp6 = 0 ;
16379  int res6 = 0 ;
16380  PyObject * obj0 = 0 ;
16381  PyObject * obj1 = 0 ;
16382  PyObject * obj2 = 0 ;
16383  PyObject * obj3 = 0 ;
16384  PyObject * obj4 = 0 ;
16385  PyObject * obj5 = 0 ;
16386  size_t result;
16387 
16388  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:merge_result_table_with",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
16389  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16390  if (!SWIG_IsOK(ecode1)) {
16391  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "merge_result_table_with" "', argument " "1"" of type '" "size_t""'");
16392  }
16393  arg1 = static_cast< size_t >(val1);
16394  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
16395  if (!SWIG_IsOK(ecode2)) {
16396  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "merge_result_table_with" "', argument " "2"" of type '" "size_t""'");
16397  }
16398  arg2 = static_cast< size_t >(val2);
16399  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_long, 0 | 0 );
16400  if (!SWIG_IsOK(res3)) {
16401  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "merge_result_table_with" "', argument " "3"" of type '" "long *""'");
16402  }
16403  arg3 = reinterpret_cast< long * >(argp3);
16404  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
16405  if (!SWIG_IsOK(res4)) {
16406  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "merge_result_table_with" "', argument " "4"" of type '" "float *""'");
16407  }
16408  arg4 = reinterpret_cast< float * >(argp4);
16409  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_long, 0 | 0 );
16410  if (!SWIG_IsOK(res5)) {
16411  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "merge_result_table_with" "', argument " "5"" of type '" "long const *""'");
16412  }
16413  arg5 = reinterpret_cast< long * >(argp5);
16414  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 );
16415  if (!SWIG_IsOK(res6)) {
16416  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "merge_result_table_with" "', argument " "6"" of type '" "float const *""'");
16417  }
16418  arg6 = reinterpret_cast< float * >(argp6);
16419  {
16420  Py_BEGIN_ALLOW_THREADS
16421  try {
16422  result = (size_t)faiss::merge_result_table_with(arg1,arg2,arg3,arg4,(long const *)arg5,(float const *)arg6);
16423  } catch(faiss::FaissException & e) {
16424  PyEval_RestoreThread(_save);
16425 
16426  if (PyErr_Occurred()) {
16427  // some previous code already set the error type.
16428  } else {
16429  PyErr_SetString(PyExc_RuntimeError, e.what());
16430  }
16431  SWIG_fail;
16432  }
16433  Py_END_ALLOW_THREADS
16434  }
16435  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
16436  return resultobj;
16437 fail:
16438  return NULL;
16439 }
16440 
16441 
16442 SWIGINTERN PyObject *_wrap_merge_result_table_with(PyObject *self, PyObject *args) {
16443  Py_ssize_t argc;
16444  PyObject *argv[9] = {
16445  0
16446  };
16447  Py_ssize_t ii;
16448 
16449  if (!PyTuple_Check(args)) SWIG_fail;
16450  argc = args ? PyObject_Length(args) : 0;
16451  for (ii = 0; (ii < 8) && (ii < argc); ii++) {
16452  argv[ii] = PyTuple_GET_ITEM(args,ii);
16453  }
16454  if (argc == 6) {
16455  int _v;
16456  {
16457  int res = SWIG_AsVal_size_t(argv[0], NULL);
16458  _v = SWIG_CheckState(res);
16459  }
16460  if (_v) {
16461  {
16462  int res = SWIG_AsVal_size_t(argv[1], NULL);
16463  _v = SWIG_CheckState(res);
16464  }
16465  if (_v) {
16466  void *vptr = 0;
16467  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0);
16468  _v = SWIG_CheckState(res);
16469  if (_v) {
16470  void *vptr = 0;
16471  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
16472  _v = SWIG_CheckState(res);
16473  if (_v) {
16474  void *vptr = 0;
16475  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0);
16476  _v = SWIG_CheckState(res);
16477  if (_v) {
16478  void *vptr = 0;
16479  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
16480  _v = SWIG_CheckState(res);
16481  if (_v) {
16482  return _wrap_merge_result_table_with__SWIG_2(self, args);
16483  }
16484  }
16485  }
16486  }
16487  }
16488  }
16489  }
16490  if (argc == 7) {
16491  int _v;
16492  {
16493  int res = SWIG_AsVal_size_t(argv[0], NULL);
16494  _v = SWIG_CheckState(res);
16495  }
16496  if (_v) {
16497  {
16498  int res = SWIG_AsVal_size_t(argv[1], NULL);
16499  _v = SWIG_CheckState(res);
16500  }
16501  if (_v) {
16502  void *vptr = 0;
16503  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0);
16504  _v = SWIG_CheckState(res);
16505  if (_v) {
16506  void *vptr = 0;
16507  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
16508  _v = SWIG_CheckState(res);
16509  if (_v) {
16510  void *vptr = 0;
16511  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0);
16512  _v = SWIG_CheckState(res);
16513  if (_v) {
16514  void *vptr = 0;
16515  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
16516  _v = SWIG_CheckState(res);
16517  if (_v) {
16518  {
16519  int res = SWIG_AsVal_bool(argv[6], NULL);
16520  _v = SWIG_CheckState(res);
16521  }
16522  if (_v) {
16523  return _wrap_merge_result_table_with__SWIG_1(self, args);
16524  }
16525  }
16526  }
16527  }
16528  }
16529  }
16530  }
16531  }
16532  if (argc == 8) {
16533  int _v;
16534  {
16535  int res = SWIG_AsVal_size_t(argv[0], NULL);
16536  _v = SWIG_CheckState(res);
16537  }
16538  if (_v) {
16539  {
16540  int res = SWIG_AsVal_size_t(argv[1], NULL);
16541  _v = SWIG_CheckState(res);
16542  }
16543  if (_v) {
16544  void *vptr = 0;
16545  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_long, 0);
16546  _v = SWIG_CheckState(res);
16547  if (_v) {
16548  void *vptr = 0;
16549  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
16550  _v = SWIG_CheckState(res);
16551  if (_v) {
16552  void *vptr = 0;
16553  int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_long, 0);
16554  _v = SWIG_CheckState(res);
16555  if (_v) {
16556  void *vptr = 0;
16557  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_float, 0);
16558  _v = SWIG_CheckState(res);
16559  if (_v) {
16560  {
16561  int res = SWIG_AsVal_bool(argv[6], NULL);
16562  _v = SWIG_CheckState(res);
16563  }
16564  if (_v) {
16565  {
16566  int res = SWIG_AsVal_long(argv[7], NULL);
16567  _v = SWIG_CheckState(res);
16568  }
16569  if (_v) {
16570  return _wrap_merge_result_table_with__SWIG_0(self, args);
16571  }
16572  }
16573  }
16574  }
16575  }
16576  }
16577  }
16578  }
16579  }
16580 
16581 fail:
16582  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'merge_result_table_with'.\n"
16583  " Possible C/C++ prototypes are:\n"
16584  " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool,long)\n"
16585  " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *,bool)\n"
16586  " faiss::merge_result_table_with(size_t,size_t,long *,float *,long const *,float const *)\n");
16587  return 0;
16588 }
16589 
16590 
16591 SWIGINTERN PyObject *_wrap_fvec_argsort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16592  PyObject *resultobj = 0;
16593  size_t arg1 ;
16594  float *arg2 = (float *) 0 ;
16595  size_t *arg3 = (size_t *) 0 ;
16596  size_t val1 ;
16597  int ecode1 = 0 ;
16598  void *argp2 = 0 ;
16599  int res2 = 0 ;
16600  void *argp3 = 0 ;
16601  int res3 = 0 ;
16602  PyObject * obj0 = 0 ;
16603  PyObject * obj1 = 0 ;
16604  PyObject * obj2 = 0 ;
16605 
16606  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort",&obj0,&obj1,&obj2)) SWIG_fail;
16607  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16608  if (!SWIG_IsOK(ecode1)) {
16609  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort" "', argument " "1"" of type '" "size_t""'");
16610  }
16611  arg1 = static_cast< size_t >(val1);
16612  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
16613  if (!SWIG_IsOK(res2)) {
16614  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort" "', argument " "2"" of type '" "float const *""'");
16615  }
16616  arg2 = reinterpret_cast< float * >(argp2);
16617  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 );
16618  if (!SWIG_IsOK(res3)) {
16619  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort" "', argument " "3"" of type '" "size_t *""'");
16620  }
16621  arg3 = reinterpret_cast< size_t * >(argp3);
16622  {
16623  Py_BEGIN_ALLOW_THREADS
16624  try {
16625  faiss::fvec_argsort(arg1,(float const *)arg2,arg3);
16626  } catch(faiss::FaissException & e) {
16627  PyEval_RestoreThread(_save);
16628 
16629  if (PyErr_Occurred()) {
16630  // some previous code already set the error type.
16631  } else {
16632  PyErr_SetString(PyExc_RuntimeError, e.what());
16633  }
16634  SWIG_fail;
16635  }
16636  Py_END_ALLOW_THREADS
16637  }
16638  resultobj = SWIG_Py_Void();
16639  return resultobj;
16640 fail:
16641  return NULL;
16642 }
16643 
16644 
16645 SWIGINTERN PyObject *_wrap_fvec_argsort_parallel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16646  PyObject *resultobj = 0;
16647  size_t arg1 ;
16648  float *arg2 = (float *) 0 ;
16649  size_t *arg3 = (size_t *) 0 ;
16650  size_t val1 ;
16651  int ecode1 = 0 ;
16652  void *argp2 = 0 ;
16653  int res2 = 0 ;
16654  void *argp3 = 0 ;
16655  int res3 = 0 ;
16656  PyObject * obj0 = 0 ;
16657  PyObject * obj1 = 0 ;
16658  PyObject * obj2 = 0 ;
16659 
16660  if (!PyArg_ParseTuple(args,(char *)"OOO:fvec_argsort_parallel",&obj0,&obj1,&obj2)) SWIG_fail;
16661  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16662  if (!SWIG_IsOK(ecode1)) {
16663  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvec_argsort_parallel" "', argument " "1"" of type '" "size_t""'");
16664  }
16665  arg1 = static_cast< size_t >(val1);
16666  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
16667  if (!SWIG_IsOK(res2)) {
16668  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvec_argsort_parallel" "', argument " "2"" of type '" "float const *""'");
16669  }
16670  arg2 = reinterpret_cast< float * >(argp2);
16671  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_long, 0 | 0 );
16672  if (!SWIG_IsOK(res3)) {
16673  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fvec_argsort_parallel" "', argument " "3"" of type '" "size_t *""'");
16674  }
16675  arg3 = reinterpret_cast< size_t * >(argp3);
16676  {
16677  Py_BEGIN_ALLOW_THREADS
16678  try {
16679  faiss::fvec_argsort_parallel(arg1,(float const *)arg2,arg3);
16680  } catch(faiss::FaissException & e) {
16681  PyEval_RestoreThread(_save);
16682 
16683  if (PyErr_Occurred()) {
16684  // some previous code already set the error type.
16685  } else {
16686  PyErr_SetString(PyExc_RuntimeError, e.what());
16687  }
16688  SWIG_fail;
16689  }
16690  Py_END_ALLOW_THREADS
16691  }
16692  resultobj = SWIG_Py_Void();
16693  return resultobj;
16694 fail:
16695  return NULL;
16696 }
16697 
16698 
16699 SWIGINTERN PyObject *_wrap_ivec_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16700  PyObject *resultobj = 0;
16701  size_t arg1 ;
16702  int *arg2 = (int *) 0 ;
16703  int arg3 ;
16704  int *arg4 = (int *) 0 ;
16705  size_t val1 ;
16706  int ecode1 = 0 ;
16707  void *argp2 = 0 ;
16708  int res2 = 0 ;
16709  int val3 ;
16710  int ecode3 = 0 ;
16711  void *argp4 = 0 ;
16712  int res4 = 0 ;
16713  PyObject * obj0 = 0 ;
16714  PyObject * obj1 = 0 ;
16715  PyObject * obj2 = 0 ;
16716  PyObject * obj3 = 0 ;
16717  int result;
16718 
16719  if (!PyArg_ParseTuple(args,(char *)"OOOO:ivec_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
16720  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16721  if (!SWIG_IsOK(ecode1)) {
16722  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_hist" "', argument " "1"" of type '" "size_t""'");
16723  }
16724  arg1 = static_cast< size_t >(val1);
16725  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 );
16726  if (!SWIG_IsOK(res2)) {
16727  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_hist" "', argument " "2"" of type '" "int const *""'");
16728  }
16729  arg2 = reinterpret_cast< int * >(argp2);
16730  ecode3 = SWIG_AsVal_int(obj2, &val3);
16731  if (!SWIG_IsOK(ecode3)) {
16732  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ivec_hist" "', argument " "3"" of type '" "int""'");
16733  }
16734  arg3 = static_cast< int >(val3);
16735  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 );
16736  if (!SWIG_IsOK(res4)) {
16737  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ivec_hist" "', argument " "4"" of type '" "int *""'");
16738  }
16739  arg4 = reinterpret_cast< int * >(argp4);
16740  {
16741  Py_BEGIN_ALLOW_THREADS
16742  try {
16743  result = (int)faiss::ivec_hist(arg1,(int const *)arg2,arg3,arg4);
16744  } catch(faiss::FaissException & e) {
16745  PyEval_RestoreThread(_save);
16746 
16747  if (PyErr_Occurred()) {
16748  // some previous code already set the error type.
16749  } else {
16750  PyErr_SetString(PyExc_RuntimeError, e.what());
16751  }
16752  SWIG_fail;
16753  }
16754  Py_END_ALLOW_THREADS
16755  }
16756  resultobj = SWIG_From_int(static_cast< int >(result));
16757  return resultobj;
16758 fail:
16759  return NULL;
16760 }
16761 
16762 
16763 SWIGINTERN PyObject *_wrap_bincode_hist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16764  PyObject *resultobj = 0;
16765  size_t arg1 ;
16766  size_t arg2 ;
16767  uint8_t *arg3 = (uint8_t *) 0 ;
16768  int *arg4 = (int *) 0 ;
16769  size_t val1 ;
16770  int ecode1 = 0 ;
16771  size_t val2 ;
16772  int ecode2 = 0 ;
16773  void *argp3 = 0 ;
16774  int res3 = 0 ;
16775  void *argp4 = 0 ;
16776  int res4 = 0 ;
16777  PyObject * obj0 = 0 ;
16778  PyObject * obj1 = 0 ;
16779  PyObject * obj2 = 0 ;
16780  PyObject * obj3 = 0 ;
16781 
16782  if (!PyArg_ParseTuple(args,(char *)"OOOO:bincode_hist",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
16783  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16784  if (!SWIG_IsOK(ecode1)) {
16785  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bincode_hist" "', argument " "1"" of type '" "size_t""'");
16786  }
16787  arg1 = static_cast< size_t >(val1);
16788  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
16789  if (!SWIG_IsOK(ecode2)) {
16790  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bincode_hist" "', argument " "2"" of type '" "size_t""'");
16791  }
16792  arg2 = static_cast< size_t >(val2);
16793  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
16794  if (!SWIG_IsOK(res3)) {
16795  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "bincode_hist" "', argument " "3"" of type '" "uint8_t const *""'");
16796  }
16797  arg3 = reinterpret_cast< uint8_t * >(argp3);
16798  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 );
16799  if (!SWIG_IsOK(res4)) {
16800  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "bincode_hist" "', argument " "4"" of type '" "int *""'");
16801  }
16802  arg4 = reinterpret_cast< int * >(argp4);
16803  {
16804  Py_BEGIN_ALLOW_THREADS
16805  try {
16806  faiss::bincode_hist(arg1,arg2,(unsigned char const *)arg3,arg4);
16807  } catch(faiss::FaissException & e) {
16808  PyEval_RestoreThread(_save);
16809 
16810  if (PyErr_Occurred()) {
16811  // some previous code already set the error type.
16812  } else {
16813  PyErr_SetString(PyExc_RuntimeError, e.what());
16814  }
16815  SWIG_fail;
16816  }
16817  Py_END_ALLOW_THREADS
16818  }
16819  resultobj = SWIG_Py_Void();
16820  return resultobj;
16821 fail:
16822  return NULL;
16823 }
16824 
16825 
16826 SWIGINTERN PyObject *_wrap_ivec_checksum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16827  PyObject *resultobj = 0;
16828  size_t arg1 ;
16829  int *arg2 = (int *) 0 ;
16830  size_t val1 ;
16831  int ecode1 = 0 ;
16832  void *argp2 = 0 ;
16833  int res2 = 0 ;
16834  PyObject * obj0 = 0 ;
16835  PyObject * obj1 = 0 ;
16836  size_t result;
16837 
16838  if (!PyArg_ParseTuple(args,(char *)"OO:ivec_checksum",&obj0,&obj1)) SWIG_fail;
16839  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16840  if (!SWIG_IsOK(ecode1)) {
16841  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ivec_checksum" "', argument " "1"" of type '" "size_t""'");
16842  }
16843  arg1 = static_cast< size_t >(val1);
16844  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 );
16845  if (!SWIG_IsOK(res2)) {
16846  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ivec_checksum" "', argument " "2"" of type '" "int const *""'");
16847  }
16848  arg2 = reinterpret_cast< int * >(argp2);
16849  {
16850  Py_BEGIN_ALLOW_THREADS
16851  try {
16852  result = (size_t)faiss::ivec_checksum(arg1,(int const *)arg2);
16853  } catch(faiss::FaissException & e) {
16854  PyEval_RestoreThread(_save);
16855 
16856  if (PyErr_Occurred()) {
16857  // some previous code already set the error type.
16858  } else {
16859  PyErr_SetString(PyExc_RuntimeError, e.what());
16860  }
16861  SWIG_fail;
16862  }
16863  Py_END_ALLOW_THREADS
16864  }
16865  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
16866  return resultobj;
16867 fail:
16868  return NULL;
16869 }
16870 
16871 
16872 SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16873  PyObject *resultobj = 0;
16874  size_t arg1 ;
16875  size_t *arg2 = (size_t *) 0 ;
16876  size_t arg3 ;
16877  float *arg4 = (float *) 0 ;
16878  bool arg5 ;
16879  long arg6 ;
16880  size_t val1 ;
16881  int ecode1 = 0 ;
16882  void *argp2 = 0 ;
16883  int res2 = 0 ;
16884  size_t val3 ;
16885  int ecode3 = 0 ;
16886  void *argp4 = 0 ;
16887  int res4 = 0 ;
16888  bool val5 ;
16889  int ecode5 = 0 ;
16890  long val6 ;
16891  int ecode6 = 0 ;
16892  PyObject * obj0 = 0 ;
16893  PyObject * obj1 = 0 ;
16894  PyObject * obj2 = 0 ;
16895  PyObject * obj3 = 0 ;
16896  PyObject * obj4 = 0 ;
16897  PyObject * obj5 = 0 ;
16898  float *result = 0 ;
16899 
16900  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
16901  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16902  if (!SWIG_IsOK(ecode1)) {
16903  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'");
16904  }
16905  arg1 = static_cast< size_t >(val1);
16906  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 );
16907  if (!SWIG_IsOK(res2)) {
16908  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'");
16909  }
16910  arg2 = reinterpret_cast< size_t * >(argp2);
16911  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
16912  if (!SWIG_IsOK(ecode3)) {
16913  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'");
16914  }
16915  arg3 = static_cast< size_t >(val3);
16916  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
16917  if (!SWIG_IsOK(res4)) {
16918  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'");
16919  }
16920  arg4 = reinterpret_cast< float * >(argp4);
16921  ecode5 = SWIG_AsVal_bool(obj4, &val5);
16922  if (!SWIG_IsOK(ecode5)) {
16923  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'");
16924  }
16925  arg5 = static_cast< bool >(val5);
16926  ecode6 = SWIG_AsVal_long(obj5, &val6);
16927  if (!SWIG_IsOK(ecode6)) {
16928  SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "fvecs_maybe_subsample" "', argument " "6"" of type '" "long""'");
16929  }
16930  arg6 = static_cast< long >(val6);
16931  {
16932  Py_BEGIN_ALLOW_THREADS
16933  try {
16934  result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5,arg6);
16935  } catch(faiss::FaissException & e) {
16936  PyEval_RestoreThread(_save);
16937 
16938  if (PyErr_Occurred()) {
16939  // some previous code already set the error type.
16940  } else {
16941  PyErr_SetString(PyExc_RuntimeError, e.what());
16942  }
16943  SWIG_fail;
16944  }
16945  Py_END_ALLOW_THREADS
16946  }
16947  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
16948  return resultobj;
16949 fail:
16950  return NULL;
16951 }
16952 
16953 
16954 SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16955  PyObject *resultobj = 0;
16956  size_t arg1 ;
16957  size_t *arg2 = (size_t *) 0 ;
16958  size_t arg3 ;
16959  float *arg4 = (float *) 0 ;
16960  bool arg5 ;
16961  size_t val1 ;
16962  int ecode1 = 0 ;
16963  void *argp2 = 0 ;
16964  int res2 = 0 ;
16965  size_t val3 ;
16966  int ecode3 = 0 ;
16967  void *argp4 = 0 ;
16968  int res4 = 0 ;
16969  bool val5 ;
16970  int ecode5 = 0 ;
16971  PyObject * obj0 = 0 ;
16972  PyObject * obj1 = 0 ;
16973  PyObject * obj2 = 0 ;
16974  PyObject * obj3 = 0 ;
16975  PyObject * obj4 = 0 ;
16976  float *result = 0 ;
16977 
16978  if (!PyArg_ParseTuple(args,(char *)"OOOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
16979  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
16980  if (!SWIG_IsOK(ecode1)) {
16981  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'");
16982  }
16983  arg1 = static_cast< size_t >(val1);
16984  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 );
16985  if (!SWIG_IsOK(res2)) {
16986  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'");
16987  }
16988  arg2 = reinterpret_cast< size_t * >(argp2);
16989  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
16990  if (!SWIG_IsOK(ecode3)) {
16991  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'");
16992  }
16993  arg3 = static_cast< size_t >(val3);
16994  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
16995  if (!SWIG_IsOK(res4)) {
16996  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'");
16997  }
16998  arg4 = reinterpret_cast< float * >(argp4);
16999  ecode5 = SWIG_AsVal_bool(obj4, &val5);
17000  if (!SWIG_IsOK(ecode5)) {
17001  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "fvecs_maybe_subsample" "', argument " "5"" of type '" "bool""'");
17002  }
17003  arg5 = static_cast< bool >(val5);
17004  {
17005  Py_BEGIN_ALLOW_THREADS
17006  try {
17007  result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4,arg5);
17008  } catch(faiss::FaissException & e) {
17009  PyEval_RestoreThread(_save);
17010 
17011  if (PyErr_Occurred()) {
17012  // some previous code already set the error type.
17013  } else {
17014  PyErr_SetString(PyExc_RuntimeError, e.what());
17015  }
17016  SWIG_fail;
17017  }
17018  Py_END_ALLOW_THREADS
17019  }
17020  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
17021  return resultobj;
17022 fail:
17023  return NULL;
17024 }
17025 
17026 
17027 SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17028  PyObject *resultobj = 0;
17029  size_t arg1 ;
17030  size_t *arg2 = (size_t *) 0 ;
17031  size_t arg3 ;
17032  float *arg4 = (float *) 0 ;
17033  size_t val1 ;
17034  int ecode1 = 0 ;
17035  void *argp2 = 0 ;
17036  int res2 = 0 ;
17037  size_t val3 ;
17038  int ecode3 = 0 ;
17039  void *argp4 = 0 ;
17040  int res4 = 0 ;
17041  PyObject * obj0 = 0 ;
17042  PyObject * obj1 = 0 ;
17043  PyObject * obj2 = 0 ;
17044  PyObject * obj3 = 0 ;
17045  float *result = 0 ;
17046 
17047  if (!PyArg_ParseTuple(args,(char *)"OOOO:fvecs_maybe_subsample",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
17048  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
17049  if (!SWIG_IsOK(ecode1)) {
17050  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fvecs_maybe_subsample" "', argument " "1"" of type '" "size_t""'");
17051  }
17052  arg1 = static_cast< size_t >(val1);
17053  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_long, 0 | 0 );
17054  if (!SWIG_IsOK(res2)) {
17055  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fvecs_maybe_subsample" "', argument " "2"" of type '" "size_t *""'");
17056  }
17057  arg2 = reinterpret_cast< size_t * >(argp2);
17058  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
17059  if (!SWIG_IsOK(ecode3)) {
17060  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "fvecs_maybe_subsample" "', argument " "3"" of type '" "size_t""'");
17061  }
17062  arg3 = static_cast< size_t >(val3);
17063  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
17064  if (!SWIG_IsOK(res4)) {
17065  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "fvecs_maybe_subsample" "', argument " "4"" of type '" "float const *""'");
17066  }
17067  arg4 = reinterpret_cast< float * >(argp4);
17068  {
17069  Py_BEGIN_ALLOW_THREADS
17070  try {
17071  result = (float *)faiss::fvecs_maybe_subsample(arg1,arg2,arg3,(float const *)arg4);
17072  } catch(faiss::FaissException & e) {
17073  PyEval_RestoreThread(_save);
17074 
17075  if (PyErr_Occurred()) {
17076  // some previous code already set the error type.
17077  } else {
17078  PyErr_SetString(PyExc_RuntimeError, e.what());
17079  }
17080  SWIG_fail;
17081  }
17082  Py_END_ALLOW_THREADS
17083  }
17084  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
17085  return resultobj;
17086 fail:
17087  return NULL;
17088 }
17089 
17090 
17091 SWIGINTERN PyObject *_wrap_fvecs_maybe_subsample(PyObject *self, PyObject *args) {
17092  Py_ssize_t argc;
17093  PyObject *argv[7] = {
17094  0
17095  };
17096  Py_ssize_t ii;
17097 
17098  if (!PyTuple_Check(args)) SWIG_fail;
17099  argc = args ? PyObject_Length(args) : 0;
17100  for (ii = 0; (ii < 6) && (ii < argc); ii++) {
17101  argv[ii] = PyTuple_GET_ITEM(args,ii);
17102  }
17103  if (argc == 4) {
17104  int _v;
17105  {
17106  int res = SWIG_AsVal_size_t(argv[0], NULL);
17107  _v = SWIG_CheckState(res);
17108  }
17109  if (_v) {
17110  void *vptr = 0;
17111  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0);
17112  _v = SWIG_CheckState(res);
17113  if (_v) {
17114  {
17115  int res = SWIG_AsVal_size_t(argv[2], NULL);
17116  _v = SWIG_CheckState(res);
17117  }
17118  if (_v) {
17119  void *vptr = 0;
17120  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
17121  _v = SWIG_CheckState(res);
17122  if (_v) {
17123  return _wrap_fvecs_maybe_subsample__SWIG_2(self, args);
17124  }
17125  }
17126  }
17127  }
17128  }
17129  if (argc == 5) {
17130  int _v;
17131  {
17132  int res = SWIG_AsVal_size_t(argv[0], NULL);
17133  _v = SWIG_CheckState(res);
17134  }
17135  if (_v) {
17136  void *vptr = 0;
17137  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0);
17138  _v = SWIG_CheckState(res);
17139  if (_v) {
17140  {
17141  int res = SWIG_AsVal_size_t(argv[2], NULL);
17142  _v = SWIG_CheckState(res);
17143  }
17144  if (_v) {
17145  void *vptr = 0;
17146  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
17147  _v = SWIG_CheckState(res);
17148  if (_v) {
17149  {
17150  int res = SWIG_AsVal_bool(argv[4], NULL);
17151  _v = SWIG_CheckState(res);
17152  }
17153  if (_v) {
17154  return _wrap_fvecs_maybe_subsample__SWIG_1(self, args);
17155  }
17156  }
17157  }
17158  }
17159  }
17160  }
17161  if (argc == 6) {
17162  int _v;
17163  {
17164  int res = SWIG_AsVal_size_t(argv[0], NULL);
17165  _v = SWIG_CheckState(res);
17166  }
17167  if (_v) {
17168  void *vptr = 0;
17169  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_long, 0);
17170  _v = SWIG_CheckState(res);
17171  if (_v) {
17172  {
17173  int res = SWIG_AsVal_size_t(argv[2], NULL);
17174  _v = SWIG_CheckState(res);
17175  }
17176  if (_v) {
17177  void *vptr = 0;
17178  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_float, 0);
17179  _v = SWIG_CheckState(res);
17180  if (_v) {
17181  {
17182  int res = SWIG_AsVal_bool(argv[4], NULL);
17183  _v = SWIG_CheckState(res);
17184  }
17185  if (_v) {
17186  {
17187  int res = SWIG_AsVal_long(argv[5], NULL);
17188  _v = SWIG_CheckState(res);
17189  }
17190  if (_v) {
17191  return _wrap_fvecs_maybe_subsample__SWIG_0(self, args);
17192  }
17193  }
17194  }
17195  }
17196  }
17197  }
17198  }
17199 
17200 fail:
17201  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'fvecs_maybe_subsample'.\n"
17202  " Possible C/C++ prototypes are:\n"
17203  " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool,long)\n"
17204  " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *,bool)\n"
17205  " faiss::fvecs_maybe_subsample(size_t,size_t *,size_t,float const *)\n");
17206  return 0;
17207 }
17208 
17209 
17210 SWIGINTERN PyObject *_wrap_binary_to_real(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17211  PyObject *resultobj = 0;
17212  size_t arg1 ;
17213  uint8_t *arg2 = (uint8_t *) 0 ;
17214  float *arg3 = (float *) 0 ;
17215  size_t val1 ;
17216  int ecode1 = 0 ;
17217  void *argp2 = 0 ;
17218  int res2 = 0 ;
17219  void *argp3 = 0 ;
17220  int res3 = 0 ;
17221  PyObject * obj0 = 0 ;
17222  PyObject * obj1 = 0 ;
17223  PyObject * obj2 = 0 ;
17224 
17225  if (!PyArg_ParseTuple(args,(char *)"OOO:binary_to_real",&obj0,&obj1,&obj2)) SWIG_fail;
17226  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
17227  if (!SWIG_IsOK(ecode1)) {
17228  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "binary_to_real" "', argument " "1"" of type '" "size_t""'");
17229  }
17230  arg1 = static_cast< size_t >(val1);
17231  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
17232  if (!SWIG_IsOK(res2)) {
17233  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "binary_to_real" "', argument " "2"" of type '" "uint8_t const *""'");
17234  }
17235  arg2 = reinterpret_cast< uint8_t * >(argp2);
17236  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17237  if (!SWIG_IsOK(res3)) {
17238  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "binary_to_real" "', argument " "3"" of type '" "float *""'");
17239  }
17240  arg3 = reinterpret_cast< float * >(argp3);
17241  {
17242  Py_BEGIN_ALLOW_THREADS
17243  try {
17244  faiss::binary_to_real(arg1,(unsigned char const *)arg2,arg3);
17245  } catch(faiss::FaissException & e) {
17246  PyEval_RestoreThread(_save);
17247 
17248  if (PyErr_Occurred()) {
17249  // some previous code already set the error type.
17250  } else {
17251  PyErr_SetString(PyExc_RuntimeError, e.what());
17252  }
17253  SWIG_fail;
17254  }
17255  Py_END_ALLOW_THREADS
17256  }
17257  resultobj = SWIG_Py_Void();
17258  return resultobj;
17259 fail:
17260  return NULL;
17261 }
17262 
17263 
17264 SWIGINTERN PyObject *_wrap_real_to_binary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17265  PyObject *resultobj = 0;
17266  size_t arg1 ;
17267  float *arg2 = (float *) 0 ;
17268  uint8_t *arg3 = (uint8_t *) 0 ;
17269  size_t val1 ;
17270  int ecode1 = 0 ;
17271  void *argp2 = 0 ;
17272  int res2 = 0 ;
17273  void *argp3 = 0 ;
17274  int res3 = 0 ;
17275  PyObject * obj0 = 0 ;
17276  PyObject * obj1 = 0 ;
17277  PyObject * obj2 = 0 ;
17278 
17279  if (!PyArg_ParseTuple(args,(char *)"OOO:real_to_binary",&obj0,&obj1,&obj2)) SWIG_fail;
17280  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
17281  if (!SWIG_IsOK(ecode1)) {
17282  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "real_to_binary" "', argument " "1"" of type '" "size_t""'");
17283  }
17284  arg1 = static_cast< size_t >(val1);
17285  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
17286  if (!SWIG_IsOK(res2)) {
17287  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "real_to_binary" "', argument " "2"" of type '" "float const *""'");
17288  }
17289  arg2 = reinterpret_cast< float * >(argp2);
17290  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
17291  if (!SWIG_IsOK(res3)) {
17292  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "real_to_binary" "', argument " "3"" of type '" "uint8_t *""'");
17293  }
17294  arg3 = reinterpret_cast< uint8_t * >(argp3);
17295  {
17296  Py_BEGIN_ALLOW_THREADS
17297  try {
17298  faiss::real_to_binary(arg1,(float const *)arg2,arg3);
17299  } catch(faiss::FaissException & e) {
17300  PyEval_RestoreThread(_save);
17301 
17302  if (PyErr_Occurred()) {
17303  // some previous code already set the error type.
17304  } else {
17305  PyErr_SetString(PyExc_RuntimeError, e.what());
17306  }
17307  SWIG_fail;
17308  }
17309  Py_END_ALLOW_THREADS
17310  }
17311  resultobj = SWIG_Py_Void();
17312  return resultobj;
17313 fail:
17314  return NULL;
17315 }
17316 
17317 
17318 SWIGINTERN PyObject *_wrap_hash_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17319  PyObject *resultobj = 0;
17320  uint8_t *arg1 = (uint8_t *) 0 ;
17321  long arg2 ;
17322  void *argp1 = 0 ;
17323  int res1 = 0 ;
17324  long val2 ;
17325  int ecode2 = 0 ;
17326  PyObject * obj0 = 0 ;
17327  PyObject * obj1 = 0 ;
17328  uint64_t result;
17329 
17330  if (!PyArg_ParseTuple(args,(char *)"OO:hash_bytes",&obj0,&obj1)) SWIG_fail;
17331  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_unsigned_char, 0 | 0 );
17332  if (!SWIG_IsOK(res1)) {
17333  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hash_bytes" "', argument " "1"" of type '" "uint8_t const *""'");
17334  }
17335  arg1 = reinterpret_cast< uint8_t * >(argp1);
17336  ecode2 = SWIG_AsVal_long(obj1, &val2);
17337  if (!SWIG_IsOK(ecode2)) {
17338  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "hash_bytes" "', argument " "2"" of type '" "long""'");
17339  }
17340  arg2 = static_cast< long >(val2);
17341  {
17342  Py_BEGIN_ALLOW_THREADS
17343  try {
17344  result = (uint64_t)faiss::hash_bytes((unsigned char const *)arg1,arg2);
17345  } catch(faiss::FaissException & e) {
17346  PyEval_RestoreThread(_save);
17347 
17348  if (PyErr_Occurred()) {
17349  // some previous code already set the error type.
17350  } else {
17351  PyErr_SetString(PyExc_RuntimeError, e.what());
17352  }
17353  SWIG_fail;
17354  }
17355  Py_END_ALLOW_THREADS
17356  }
17357  resultobj = SWIG_From_unsigned_SS_long(static_cast< unsigned long >(result));
17358  return resultobj;
17359 fail:
17360  return NULL;
17361 }
17362 
17363 
17364 SWIGINTERN PyObject *_wrap_check_openmp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17365  PyObject *resultobj = 0;
17366  bool result;
17367 
17368  if (!PyArg_ParseTuple(args,(char *)":check_openmp")) SWIG_fail;
17369  {
17370  Py_BEGIN_ALLOW_THREADS
17371  try {
17372  result = (bool)faiss::check_openmp();
17373  } catch(faiss::FaissException & e) {
17374  PyEval_RestoreThread(_save);
17375 
17376  if (PyErr_Occurred()) {
17377  // some previous code already set the error type.
17378  } else {
17379  PyErr_SetString(PyExc_RuntimeError, e.what());
17380  }
17381  SWIG_fail;
17382  }
17383  Py_END_ALLOW_THREADS
17384  }
17385  resultobj = SWIG_From_bool(static_cast< bool >(result));
17386  return resultobj;
17387 fail:
17388  return NULL;
17389 }
17390 
17391 
17392 SWIGINTERN PyObject *_wrap_Index_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17393  PyObject *resultobj = 0;
17394  faiss::Index *arg1 = (faiss::Index *) 0 ;
17395  int arg2 ;
17396  void *argp1 = 0 ;
17397  int res1 = 0 ;
17398  int val2 ;
17399  int ecode2 = 0 ;
17400  PyObject * obj0 = 0 ;
17401  PyObject * obj1 = 0 ;
17402 
17403  if (!PyArg_ParseTuple(args,(char *)"OO:Index_d_set",&obj0,&obj1)) SWIG_fail;
17404  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17405  if (!SWIG_IsOK(res1)) {
17406  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_set" "', argument " "1"" of type '" "faiss::Index *""'");
17407  }
17408  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17409  ecode2 = SWIG_AsVal_int(obj1, &val2);
17410  if (!SWIG_IsOK(ecode2)) {
17411  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_d_set" "', argument " "2"" of type '" "int""'");
17412  }
17413  arg2 = static_cast< int >(val2);
17414  if (arg1) (arg1)->d = arg2;
17415  resultobj = SWIG_Py_Void();
17416  return resultobj;
17417 fail:
17418  return NULL;
17419 }
17420 
17421 
17422 SWIGINTERN PyObject *_wrap_Index_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17423  PyObject *resultobj = 0;
17424  faiss::Index *arg1 = (faiss::Index *) 0 ;
17425  void *argp1 = 0 ;
17426  int res1 = 0 ;
17427  PyObject * obj0 = 0 ;
17428  int result;
17429 
17430  if (!PyArg_ParseTuple(args,(char *)"O:Index_d_get",&obj0)) SWIG_fail;
17431  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17432  if (!SWIG_IsOK(res1)) {
17433  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_d_get" "', argument " "1"" of type '" "faiss::Index *""'");
17434  }
17435  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17436  result = (int) ((arg1)->d);
17437  resultobj = SWIG_From_int(static_cast< int >(result));
17438  return resultobj;
17439 fail:
17440  return NULL;
17441 }
17442 
17443 
17444 SWIGINTERN PyObject *_wrap_Index_ntotal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17445  PyObject *resultobj = 0;
17446  faiss::Index *arg1 = (faiss::Index *) 0 ;
17447  faiss::Index::idx_t arg2 ;
17448  void *argp1 = 0 ;
17449  int res1 = 0 ;
17450  long val2 ;
17451  int ecode2 = 0 ;
17452  PyObject * obj0 = 0 ;
17453  PyObject * obj1 = 0 ;
17454 
17455  if (!PyArg_ParseTuple(args,(char *)"OO:Index_ntotal_set",&obj0,&obj1)) SWIG_fail;
17456  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17457  if (!SWIG_IsOK(res1)) {
17458  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_set" "', argument " "1"" of type '" "faiss::Index *""'");
17459  }
17460  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17461  ecode2 = SWIG_AsVal_long(obj1, &val2);
17462  if (!SWIG_IsOK(ecode2)) {
17463  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_ntotal_set" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17464  }
17465  arg2 = static_cast< faiss::Index::idx_t >(val2);
17466  if (arg1) (arg1)->ntotal = arg2;
17467  resultobj = SWIG_Py_Void();
17468  return resultobj;
17469 fail:
17470  return NULL;
17471 }
17472 
17473 
17474 SWIGINTERN PyObject *_wrap_Index_ntotal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17475  PyObject *resultobj = 0;
17476  faiss::Index *arg1 = (faiss::Index *) 0 ;
17477  void *argp1 = 0 ;
17478  int res1 = 0 ;
17479  PyObject * obj0 = 0 ;
17480  faiss::Index::idx_t result;
17481 
17482  if (!PyArg_ParseTuple(args,(char *)"O:Index_ntotal_get",&obj0)) SWIG_fail;
17483  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17484  if (!SWIG_IsOK(res1)) {
17485  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_ntotal_get" "', argument " "1"" of type '" "faiss::Index *""'");
17486  }
17487  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17488  result = (faiss::Index::idx_t) ((arg1)->ntotal);
17489  resultobj = SWIG_From_long(static_cast< long >(result));
17490  return resultobj;
17491 fail:
17492  return NULL;
17493 }
17494 
17495 
17496 SWIGINTERN PyObject *_wrap_Index_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17497  PyObject *resultobj = 0;
17498  faiss::Index *arg1 = (faiss::Index *) 0 ;
17499  bool arg2 ;
17500  void *argp1 = 0 ;
17501  int res1 = 0 ;
17502  bool val2 ;
17503  int ecode2 = 0 ;
17504  PyObject * obj0 = 0 ;
17505  PyObject * obj1 = 0 ;
17506 
17507  if (!PyArg_ParseTuple(args,(char *)"OO:Index_verbose_set",&obj0,&obj1)) SWIG_fail;
17508  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17509  if (!SWIG_IsOK(res1)) {
17510  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_set" "', argument " "1"" of type '" "faiss::Index *""'");
17511  }
17512  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17513  ecode2 = SWIG_AsVal_bool(obj1, &val2);
17514  if (!SWIG_IsOK(ecode2)) {
17515  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_verbose_set" "', argument " "2"" of type '" "bool""'");
17516  }
17517  arg2 = static_cast< bool >(val2);
17518  if (arg1) (arg1)->verbose = arg2;
17519  resultobj = SWIG_Py_Void();
17520  return resultobj;
17521 fail:
17522  return NULL;
17523 }
17524 
17525 
17526 SWIGINTERN PyObject *_wrap_Index_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17527  PyObject *resultobj = 0;
17528  faiss::Index *arg1 = (faiss::Index *) 0 ;
17529  void *argp1 = 0 ;
17530  int res1 = 0 ;
17531  PyObject * obj0 = 0 ;
17532  bool result;
17533 
17534  if (!PyArg_ParseTuple(args,(char *)"O:Index_verbose_get",&obj0)) SWIG_fail;
17535  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17536  if (!SWIG_IsOK(res1)) {
17537  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_verbose_get" "', argument " "1"" of type '" "faiss::Index *""'");
17538  }
17539  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17540  result = (bool) ((arg1)->verbose);
17541  resultobj = SWIG_From_bool(static_cast< bool >(result));
17542  return resultobj;
17543 fail:
17544  return NULL;
17545 }
17546 
17547 
17548 SWIGINTERN PyObject *_wrap_Index_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17549  PyObject *resultobj = 0;
17550  faiss::Index *arg1 = (faiss::Index *) 0 ;
17551  bool arg2 ;
17552  void *argp1 = 0 ;
17553  int res1 = 0 ;
17554  bool val2 ;
17555  int ecode2 = 0 ;
17556  PyObject * obj0 = 0 ;
17557  PyObject * obj1 = 0 ;
17558 
17559  if (!PyArg_ParseTuple(args,(char *)"OO:Index_is_trained_set",&obj0,&obj1)) SWIG_fail;
17560  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17561  if (!SWIG_IsOK(res1)) {
17562  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_set" "', argument " "1"" of type '" "faiss::Index *""'");
17563  }
17564  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17565  ecode2 = SWIG_AsVal_bool(obj1, &val2);
17566  if (!SWIG_IsOK(ecode2)) {
17567  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_is_trained_set" "', argument " "2"" of type '" "bool""'");
17568  }
17569  arg2 = static_cast< bool >(val2);
17570  if (arg1) (arg1)->is_trained = arg2;
17571  resultobj = SWIG_Py_Void();
17572  return resultobj;
17573 fail:
17574  return NULL;
17575 }
17576 
17577 
17578 SWIGINTERN PyObject *_wrap_Index_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17579  PyObject *resultobj = 0;
17580  faiss::Index *arg1 = (faiss::Index *) 0 ;
17581  void *argp1 = 0 ;
17582  int res1 = 0 ;
17583  PyObject * obj0 = 0 ;
17584  bool result;
17585 
17586  if (!PyArg_ParseTuple(args,(char *)"O:Index_is_trained_get",&obj0)) SWIG_fail;
17587  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17588  if (!SWIG_IsOK(res1)) {
17589  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_is_trained_get" "', argument " "1"" of type '" "faiss::Index *""'");
17590  }
17591  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17592  result = (bool) ((arg1)->is_trained);
17593  resultobj = SWIG_From_bool(static_cast< bool >(result));
17594  return resultobj;
17595 fail:
17596  return NULL;
17597 }
17598 
17599 
17600 SWIGINTERN PyObject *_wrap_Index_metric_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17601  PyObject *resultobj = 0;
17602  faiss::Index *arg1 = (faiss::Index *) 0 ;
17603  faiss::MetricType arg2 ;
17604  void *argp1 = 0 ;
17605  int res1 = 0 ;
17606  int val2 ;
17607  int ecode2 = 0 ;
17608  PyObject * obj0 = 0 ;
17609  PyObject * obj1 = 0 ;
17610 
17611  if (!PyArg_ParseTuple(args,(char *)"OO:Index_metric_type_set",&obj0,&obj1)) SWIG_fail;
17612  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17613  if (!SWIG_IsOK(res1)) {
17614  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_set" "', argument " "1"" of type '" "faiss::Index *""'");
17615  }
17616  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17617  ecode2 = SWIG_AsVal_int(obj1, &val2);
17618  if (!SWIG_IsOK(ecode2)) {
17619  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_metric_type_set" "', argument " "2"" of type '" "faiss::MetricType""'");
17620  }
17621  arg2 = static_cast< faiss::MetricType >(val2);
17622  if (arg1) (arg1)->metric_type = arg2;
17623  resultobj = SWIG_Py_Void();
17624  return resultobj;
17625 fail:
17626  return NULL;
17627 }
17628 
17629 
17630 SWIGINTERN PyObject *_wrap_Index_metric_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17631  PyObject *resultobj = 0;
17632  faiss::Index *arg1 = (faiss::Index *) 0 ;
17633  void *argp1 = 0 ;
17634  int res1 = 0 ;
17635  PyObject * obj0 = 0 ;
17636  faiss::MetricType result;
17637 
17638  if (!PyArg_ParseTuple(args,(char *)"O:Index_metric_type_get",&obj0)) SWIG_fail;
17639  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17640  if (!SWIG_IsOK(res1)) {
17641  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_metric_type_get" "', argument " "1"" of type '" "faiss::Index *""'");
17642  }
17643  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17644  result = (faiss::MetricType) ((arg1)->metric_type);
17645  resultobj = SWIG_From_int(static_cast< int >(result));
17646  return resultobj;
17647 fail:
17648  return NULL;
17649 }
17650 
17651 
17652 SWIGINTERN PyObject *_wrap_delete_Index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17653  PyObject *resultobj = 0;
17654  faiss::Index *arg1 = (faiss::Index *) 0 ;
17655  void *argp1 = 0 ;
17656  int res1 = 0 ;
17657  PyObject * obj0 = 0 ;
17658 
17659  if (!PyArg_ParseTuple(args,(char *)"O:delete_Index",&obj0)) SWIG_fail;
17660  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 );
17661  if (!SWIG_IsOK(res1)) {
17662  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Index" "', argument " "1"" of type '" "faiss::Index *""'");
17663  }
17664  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17665  {
17666  Py_BEGIN_ALLOW_THREADS
17667  try {
17668  delete arg1;
17669  } catch(faiss::FaissException & e) {
17670  PyEval_RestoreThread(_save);
17671 
17672  if (PyErr_Occurred()) {
17673  // some previous code already set the error type.
17674  } else {
17675  PyErr_SetString(PyExc_RuntimeError, e.what());
17676  }
17677  SWIG_fail;
17678  }
17679  Py_END_ALLOW_THREADS
17680  }
17681  resultobj = SWIG_Py_Void();
17682  return resultobj;
17683 fail:
17684  return NULL;
17685 }
17686 
17687 
17688 SWIGINTERN PyObject *_wrap_Index_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17689  PyObject *resultobj = 0;
17690  faiss::Index *arg1 = (faiss::Index *) 0 ;
17691  faiss::Index::idx_t arg2 ;
17692  float *arg3 = (float *) 0 ;
17693  void *argp1 = 0 ;
17694  int res1 = 0 ;
17695  long val2 ;
17696  int ecode2 = 0 ;
17697  void *argp3 = 0 ;
17698  int res3 = 0 ;
17699  PyObject * obj0 = 0 ;
17700  PyObject * obj1 = 0 ;
17701  PyObject * obj2 = 0 ;
17702 
17703  if (!PyArg_ParseTuple(args,(char *)"OOO:Index_train",&obj0,&obj1,&obj2)) SWIG_fail;
17704  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17705  if (!SWIG_IsOK(res1)) {
17706  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_train" "', argument " "1"" of type '" "faiss::Index *""'");
17707  }
17708  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17709  ecode2 = SWIG_AsVal_long(obj1, &val2);
17710  if (!SWIG_IsOK(ecode2)) {
17711  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17712  }
17713  arg2 = static_cast< faiss::Index::idx_t >(val2);
17714  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17715  if (!SWIG_IsOK(res3)) {
17716  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_train" "', argument " "3"" of type '" "float const *""'");
17717  }
17718  arg3 = reinterpret_cast< float * >(argp3);
17719  {
17720  Py_BEGIN_ALLOW_THREADS
17721  try {
17722  (arg1)->train(arg2,(float const *)arg3);
17723  } catch(faiss::FaissException & e) {
17724  PyEval_RestoreThread(_save);
17725 
17726  if (PyErr_Occurred()) {
17727  // some previous code already set the error type.
17728  } else {
17729  PyErr_SetString(PyExc_RuntimeError, e.what());
17730  }
17731  SWIG_fail;
17732  }
17733  Py_END_ALLOW_THREADS
17734  }
17735  resultobj = SWIG_Py_Void();
17736  return resultobj;
17737 fail:
17738  return NULL;
17739 }
17740 
17741 
17742 SWIGINTERN PyObject *_wrap_Index_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17743  PyObject *resultobj = 0;
17744  faiss::Index *arg1 = (faiss::Index *) 0 ;
17745  faiss::Index::idx_t arg2 ;
17746  float *arg3 = (float *) 0 ;
17747  void *argp1 = 0 ;
17748  int res1 = 0 ;
17749  long val2 ;
17750  int ecode2 = 0 ;
17751  void *argp3 = 0 ;
17752  int res3 = 0 ;
17753  PyObject * obj0 = 0 ;
17754  PyObject * obj1 = 0 ;
17755  PyObject * obj2 = 0 ;
17756 
17757  if (!PyArg_ParseTuple(args,(char *)"OOO:Index_add",&obj0,&obj1,&obj2)) SWIG_fail;
17758  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17759  if (!SWIG_IsOK(res1)) {
17760  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add" "', argument " "1"" of type '" "faiss::Index *""'");
17761  }
17762  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17763  ecode2 = SWIG_AsVal_long(obj1, &val2);
17764  if (!SWIG_IsOK(ecode2)) {
17765  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17766  }
17767  arg2 = static_cast< faiss::Index::idx_t >(val2);
17768  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17769  if (!SWIG_IsOK(res3)) {
17770  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add" "', argument " "3"" of type '" "float const *""'");
17771  }
17772  arg3 = reinterpret_cast< float * >(argp3);
17773  {
17774  Py_BEGIN_ALLOW_THREADS
17775  try {
17776  (arg1)->add(arg2,(float const *)arg3);
17777  } catch(faiss::FaissException & e) {
17778  PyEval_RestoreThread(_save);
17779 
17780  if (PyErr_Occurred()) {
17781  // some previous code already set the error type.
17782  } else {
17783  PyErr_SetString(PyExc_RuntimeError, e.what());
17784  }
17785  SWIG_fail;
17786  }
17787  Py_END_ALLOW_THREADS
17788  }
17789  resultobj = SWIG_Py_Void();
17790  return resultobj;
17791 fail:
17792  return NULL;
17793 }
17794 
17795 
17796 SWIGINTERN PyObject *_wrap_Index_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17797  PyObject *resultobj = 0;
17798  faiss::Index *arg1 = (faiss::Index *) 0 ;
17799  faiss::Index::idx_t arg2 ;
17800  float *arg3 = (float *) 0 ;
17801  long *arg4 = (long *) 0 ;
17802  void *argp1 = 0 ;
17803  int res1 = 0 ;
17804  long val2 ;
17805  int ecode2 = 0 ;
17806  void *argp3 = 0 ;
17807  int res3 = 0 ;
17808  void *argp4 = 0 ;
17809  int res4 = 0 ;
17810  PyObject * obj0 = 0 ;
17811  PyObject * obj1 = 0 ;
17812  PyObject * obj2 = 0 ;
17813  PyObject * obj3 = 0 ;
17814 
17815  if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
17816  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17817  if (!SWIG_IsOK(res1)) {
17818  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_add_with_ids" "', argument " "1"" of type '" "faiss::Index *""'");
17819  }
17820  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17821  ecode2 = SWIG_AsVal_long(obj1, &val2);
17822  if (!SWIG_IsOK(ecode2)) {
17823  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17824  }
17825  arg2 = static_cast< faiss::Index::idx_t >(val2);
17826  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17827  if (!SWIG_IsOK(res3)) {
17828  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_add_with_ids" "', argument " "3"" of type '" "float const *""'");
17829  }
17830  arg3 = reinterpret_cast< float * >(argp3);
17831  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
17832  if (!SWIG_IsOK(res4)) {
17833  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_add_with_ids" "', argument " "4"" of type '" "long const *""'");
17834  }
17835  arg4 = reinterpret_cast< long * >(argp4);
17836  {
17837  Py_BEGIN_ALLOW_THREADS
17838  try {
17839  (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4);
17840  } catch(faiss::FaissException & e) {
17841  PyEval_RestoreThread(_save);
17842 
17843  if (PyErr_Occurred()) {
17844  // some previous code already set the error type.
17845  } else {
17846  PyErr_SetString(PyExc_RuntimeError, e.what());
17847  }
17848  SWIG_fail;
17849  }
17850  Py_END_ALLOW_THREADS
17851  }
17852  resultobj = SWIG_Py_Void();
17853  return resultobj;
17854 fail:
17855  return NULL;
17856 }
17857 
17858 
17859 SWIGINTERN PyObject *_wrap_Index_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17860  PyObject *resultobj = 0;
17861  faiss::Index *arg1 = (faiss::Index *) 0 ;
17862  faiss::Index::idx_t arg2 ;
17863  float *arg3 = (float *) 0 ;
17864  faiss::Index::idx_t arg4 ;
17865  float *arg5 = (float *) 0 ;
17867  void *argp1 = 0 ;
17868  int res1 = 0 ;
17869  long val2 ;
17870  int ecode2 = 0 ;
17871  void *argp3 = 0 ;
17872  int res3 = 0 ;
17873  long val4 ;
17874  int ecode4 = 0 ;
17875  void *argp5 = 0 ;
17876  int res5 = 0 ;
17877  void *argp6 = 0 ;
17878  int res6 = 0 ;
17879  PyObject * obj0 = 0 ;
17880  PyObject * obj1 = 0 ;
17881  PyObject * obj2 = 0 ;
17882  PyObject * obj3 = 0 ;
17883  PyObject * obj4 = 0 ;
17884  PyObject * obj5 = 0 ;
17885 
17886  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Index_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
17887  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17888  if (!SWIG_IsOK(res1)) {
17889  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search" "', argument " "1"" of type '" "faiss::Index const *""'");
17890  }
17891  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17892  ecode2 = SWIG_AsVal_long(obj1, &val2);
17893  if (!SWIG_IsOK(ecode2)) {
17894  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17895  }
17896  arg2 = static_cast< faiss::Index::idx_t >(val2);
17897  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17898  if (!SWIG_IsOK(res3)) {
17899  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search" "', argument " "3"" of type '" "float const *""'");
17900  }
17901  arg3 = reinterpret_cast< float * >(argp3);
17902  ecode4 = SWIG_AsVal_long(obj3, &val4);
17903  if (!SWIG_IsOK(ecode4)) {
17904  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
17905  }
17906  arg4 = static_cast< faiss::Index::idx_t >(val4);
17907  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
17908  if (!SWIG_IsOK(res5)) {
17909  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search" "', argument " "5"" of type '" "float *""'");
17910  }
17911  arg5 = reinterpret_cast< float * >(argp5);
17912  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 );
17913  if (!SWIG_IsOK(res6)) {
17914  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'");
17915  }
17916  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
17917  {
17918  Py_BEGIN_ALLOW_THREADS
17919  try {
17920  ((faiss::Index const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
17921  } catch(faiss::FaissException & e) {
17922  PyEval_RestoreThread(_save);
17923 
17924  if (PyErr_Occurred()) {
17925  // some previous code already set the error type.
17926  } else {
17927  PyErr_SetString(PyExc_RuntimeError, e.what());
17928  }
17929  SWIG_fail;
17930  }
17931  Py_END_ALLOW_THREADS
17932  }
17933  resultobj = SWIG_Py_Void();
17934  return resultobj;
17935 fail:
17936  return NULL;
17937 }
17938 
17939 
17940 SWIGINTERN PyObject *_wrap_Index_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17941  PyObject *resultobj = 0;
17942  faiss::Index *arg1 = (faiss::Index *) 0 ;
17943  faiss::Index::idx_t arg2 ;
17944  float *arg3 = (float *) 0 ;
17945  float arg4 ;
17947  void *argp1 = 0 ;
17948  int res1 = 0 ;
17949  long val2 ;
17950  int ecode2 = 0 ;
17951  void *argp3 = 0 ;
17952  int res3 = 0 ;
17953  float val4 ;
17954  int ecode4 = 0 ;
17955  void *argp5 = 0 ;
17956  int res5 = 0 ;
17957  PyObject * obj0 = 0 ;
17958  PyObject * obj1 = 0 ;
17959  PyObject * obj2 = 0 ;
17960  PyObject * obj3 = 0 ;
17961  PyObject * obj4 = 0 ;
17962 
17963  if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
17964  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
17965  if (!SWIG_IsOK(res1)) {
17966  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_range_search" "', argument " "1"" of type '" "faiss::Index const *""'");
17967  }
17968  arg1 = reinterpret_cast< faiss::Index * >(argp1);
17969  ecode2 = SWIG_AsVal_long(obj1, &val2);
17970  if (!SWIG_IsOK(ecode2)) {
17971  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
17972  }
17973  arg2 = static_cast< faiss::Index::idx_t >(val2);
17974  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
17975  if (!SWIG_IsOK(res3)) {
17976  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_range_search" "', argument " "3"" of type '" "float const *""'");
17977  }
17978  arg3 = reinterpret_cast< float * >(argp3);
17979  ecode4 = SWIG_AsVal_float(obj3, &val4);
17980  if (!SWIG_IsOK(ecode4)) {
17981  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_range_search" "', argument " "4"" of type '" "float""'");
17982  }
17983  arg4 = static_cast< float >(val4);
17984  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 );
17985  if (!SWIG_IsOK(res5)) {
17986  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'");
17987  }
17988  arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5);
17989  {
17990  Py_BEGIN_ALLOW_THREADS
17991  try {
17992  ((faiss::Index const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5);
17993  } catch(faiss::FaissException & e) {
17994  PyEval_RestoreThread(_save);
17995 
17996  if (PyErr_Occurred()) {
17997  // some previous code already set the error type.
17998  } else {
17999  PyErr_SetString(PyExc_RuntimeError, e.what());
18000  }
18001  SWIG_fail;
18002  }
18003  Py_END_ALLOW_THREADS
18004  }
18005  resultobj = SWIG_Py_Void();
18006  return resultobj;
18007 fail:
18008  return NULL;
18009 }
18010 
18011 
18012 SWIGINTERN PyObject *_wrap_Index_assign__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18013  PyObject *resultobj = 0;
18014  faiss::Index *arg1 = (faiss::Index *) 0 ;
18015  faiss::Index::idx_t arg2 ;
18016  float *arg3 = (float *) 0 ;
18018  faiss::Index::idx_t arg5 ;
18019  void *argp1 = 0 ;
18020  int res1 = 0 ;
18021  long val2 ;
18022  int ecode2 = 0 ;
18023  void *argp3 = 0 ;
18024  int res3 = 0 ;
18025  void *argp4 = 0 ;
18026  int res4 = 0 ;
18027  long val5 ;
18028  int ecode5 = 0 ;
18029  PyObject * obj0 = 0 ;
18030  PyObject * obj1 = 0 ;
18031  PyObject * obj2 = 0 ;
18032  PyObject * obj3 = 0 ;
18033  PyObject * obj4 = 0 ;
18034 
18035  if (!PyArg_ParseTuple(args,(char *)"OOOOO:Index_assign",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
18036  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18037  if (!SWIG_IsOK(res1)) {
18038  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'");
18039  }
18040  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18041  ecode2 = SWIG_AsVal_long(obj1, &val2);
18042  if (!SWIG_IsOK(ecode2)) {
18043  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
18044  }
18045  arg2 = static_cast< faiss::Index::idx_t >(val2);
18046  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
18047  if (!SWIG_IsOK(res3)) {
18048  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'");
18049  }
18050  arg3 = reinterpret_cast< float * >(argp3);
18051  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
18052  if (!SWIG_IsOK(res4)) {
18053  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'");
18054  }
18055  arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4);
18056  ecode5 = SWIG_AsVal_long(obj4, &val5);
18057  if (!SWIG_IsOK(ecode5)) {
18058  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Index_assign" "', argument " "5"" of type '" "faiss::Index::idx_t""'");
18059  }
18060  arg5 = static_cast< faiss::Index::idx_t >(val5);
18061  {
18062  Py_BEGIN_ALLOW_THREADS
18063  try {
18064  (arg1)->assign(arg2,(float const *)arg3,arg4,arg5);
18065  } catch(faiss::FaissException & e) {
18066  PyEval_RestoreThread(_save);
18067 
18068  if (PyErr_Occurred()) {
18069  // some previous code already set the error type.
18070  } else {
18071  PyErr_SetString(PyExc_RuntimeError, e.what());
18072  }
18073  SWIG_fail;
18074  }
18075  Py_END_ALLOW_THREADS
18076  }
18077  resultobj = SWIG_Py_Void();
18078  return resultobj;
18079 fail:
18080  return NULL;
18081 }
18082 
18083 
18084 SWIGINTERN PyObject *_wrap_Index_assign__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18085  PyObject *resultobj = 0;
18086  faiss::Index *arg1 = (faiss::Index *) 0 ;
18087  faiss::Index::idx_t arg2 ;
18088  float *arg3 = (float *) 0 ;
18090  void *argp1 = 0 ;
18091  int res1 = 0 ;
18092  long val2 ;
18093  int ecode2 = 0 ;
18094  void *argp3 = 0 ;
18095  int res3 = 0 ;
18096  void *argp4 = 0 ;
18097  int res4 = 0 ;
18098  PyObject * obj0 = 0 ;
18099  PyObject * obj1 = 0 ;
18100  PyObject * obj2 = 0 ;
18101  PyObject * obj3 = 0 ;
18102 
18103  if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_assign",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
18104  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18105  if (!SWIG_IsOK(res1)) {
18106  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_assign" "', argument " "1"" of type '" "faiss::Index *""'");
18107  }
18108  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18109  ecode2 = SWIG_AsVal_long(obj1, &val2);
18110  if (!SWIG_IsOK(ecode2)) {
18111  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_assign" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
18112  }
18113  arg2 = static_cast< faiss::Index::idx_t >(val2);
18114  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
18115  if (!SWIG_IsOK(res3)) {
18116  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_assign" "', argument " "3"" of type '" "float const *""'");
18117  }
18118  arg3 = reinterpret_cast< float * >(argp3);
18119  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
18120  if (!SWIG_IsOK(res4)) {
18121  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_assign" "', argument " "4"" of type '" "faiss::Index::idx_t *""'");
18122  }
18123  arg4 = reinterpret_cast< faiss::Index::idx_t * >(argp4);
18124  {
18125  Py_BEGIN_ALLOW_THREADS
18126  try {
18127  (arg1)->assign(arg2,(float const *)arg3,arg4);
18128  } catch(faiss::FaissException & e) {
18129  PyEval_RestoreThread(_save);
18130 
18131  if (PyErr_Occurred()) {
18132  // some previous code already set the error type.
18133  } else {
18134  PyErr_SetString(PyExc_RuntimeError, e.what());
18135  }
18136  SWIG_fail;
18137  }
18138  Py_END_ALLOW_THREADS
18139  }
18140  resultobj = SWIG_Py_Void();
18141  return resultobj;
18142 fail:
18143  return NULL;
18144 }
18145 
18146 
18147 SWIGINTERN PyObject *_wrap_Index_assign(PyObject *self, PyObject *args) {
18148  Py_ssize_t argc;
18149  PyObject *argv[6] = {
18150  0
18151  };
18152  Py_ssize_t ii;
18153 
18154  if (!PyTuple_Check(args)) SWIG_fail;
18155  argc = args ? PyObject_Length(args) : 0;
18156  for (ii = 0; (ii < 5) && (ii < argc); ii++) {
18157  argv[ii] = PyTuple_GET_ITEM(args,ii);
18158  }
18159  if (argc == 4) {
18160  int _v;
18161  void *vptr = 0;
18162  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0);
18163  _v = SWIG_CheckState(res);
18164  if (_v) {
18165  {
18166  int res = SWIG_AsVal_long(argv[1], NULL);
18167  _v = SWIG_CheckState(res);
18168  }
18169  if (_v) {
18170  void *vptr = 0;
18171  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
18172  _v = SWIG_CheckState(res);
18173  if (_v) {
18174  void *vptr = 0;
18175  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0);
18176  _v = SWIG_CheckState(res);
18177  if (_v) {
18178  return _wrap_Index_assign__SWIG_1(self, args);
18179  }
18180  }
18181  }
18182  }
18183  }
18184  if (argc == 5) {
18185  int _v;
18186  void *vptr = 0;
18187  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0);
18188  _v = SWIG_CheckState(res);
18189  if (_v) {
18190  {
18191  int res = SWIG_AsVal_long(argv[1], NULL);
18192  _v = SWIG_CheckState(res);
18193  }
18194  if (_v) {
18195  void *vptr = 0;
18196  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
18197  _v = SWIG_CheckState(res);
18198  if (_v) {
18199  void *vptr = 0;
18200  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_long, 0);
18201  _v = SWIG_CheckState(res);
18202  if (_v) {
18203  {
18204  int res = SWIG_AsVal_long(argv[4], NULL);
18205  _v = SWIG_CheckState(res);
18206  }
18207  if (_v) {
18208  return _wrap_Index_assign__SWIG_0(self, args);
18209  }
18210  }
18211  }
18212  }
18213  }
18214  }
18215 
18216 fail:
18217  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'Index_assign'.\n"
18218  " Possible C/C++ prototypes are:\n"
18219  " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *,faiss::Index::idx_t)\n"
18220  " faiss::Index::assign(faiss::Index::idx_t,float const *,faiss::Index::idx_t *)\n");
18221  return 0;
18222 }
18223 
18224 
18225 SWIGINTERN PyObject *_wrap_Index_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18226  PyObject *resultobj = 0;
18227  faiss::Index *arg1 = (faiss::Index *) 0 ;
18228  void *argp1 = 0 ;
18229  int res1 = 0 ;
18230  PyObject * obj0 = 0 ;
18231 
18232  if (!PyArg_ParseTuple(args,(char *)"O:Index_reset",&obj0)) SWIG_fail;
18233  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18234  if (!SWIG_IsOK(res1)) {
18235  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reset" "', argument " "1"" of type '" "faiss::Index *""'");
18236  }
18237  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18238  {
18239  Py_BEGIN_ALLOW_THREADS
18240  try {
18241  (arg1)->reset();
18242  } catch(faiss::FaissException & e) {
18243  PyEval_RestoreThread(_save);
18244 
18245  if (PyErr_Occurred()) {
18246  // some previous code already set the error type.
18247  } else {
18248  PyErr_SetString(PyExc_RuntimeError, e.what());
18249  }
18250  SWIG_fail;
18251  }
18252  Py_END_ALLOW_THREADS
18253  }
18254  resultobj = SWIG_Py_Void();
18255  return resultobj;
18256 fail:
18257  return NULL;
18258 }
18259 
18260 
18261 SWIGINTERN PyObject *_wrap_Index_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18262  PyObject *resultobj = 0;
18263  faiss::Index *arg1 = (faiss::Index *) 0 ;
18264  faiss::IDSelector *arg2 = 0 ;
18265  void *argp1 = 0 ;
18266  int res1 = 0 ;
18267  void *argp2 = 0 ;
18268  int res2 = 0 ;
18269  PyObject * obj0 = 0 ;
18270  PyObject * obj1 = 0 ;
18271  long result;
18272 
18273  if (!PyArg_ParseTuple(args,(char *)"OO:Index_remove_ids",&obj0,&obj1)) SWIG_fail;
18274  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18275  if (!SWIG_IsOK(res1)) {
18276  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_remove_ids" "', argument " "1"" of type '" "faiss::Index *""'");
18277  }
18278  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18279  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0);
18280  if (!SWIG_IsOK(res2)) {
18281  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'");
18282  }
18283  if (!argp2) {
18284  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Index_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'");
18285  }
18286  arg2 = reinterpret_cast< faiss::IDSelector * >(argp2);
18287  {
18288  Py_BEGIN_ALLOW_THREADS
18289  try {
18290  result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2);
18291  } catch(faiss::FaissException & e) {
18292  PyEval_RestoreThread(_save);
18293 
18294  if (PyErr_Occurred()) {
18295  // some previous code already set the error type.
18296  } else {
18297  PyErr_SetString(PyExc_RuntimeError, e.what());
18298  }
18299  SWIG_fail;
18300  }
18301  Py_END_ALLOW_THREADS
18302  }
18303  resultobj = SWIG_From_long(static_cast< long >(result));
18304  return resultobj;
18305 fail:
18306  return NULL;
18307 }
18308 
18309 
18310 SWIGINTERN PyObject *_wrap_Index_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18311  PyObject *resultobj = 0;
18312  faiss::Index *arg1 = (faiss::Index *) 0 ;
18313  faiss::Index::idx_t arg2 ;
18314  float *arg3 = (float *) 0 ;
18315  void *argp1 = 0 ;
18316  int res1 = 0 ;
18317  long val2 ;
18318  int ecode2 = 0 ;
18319  void *argp3 = 0 ;
18320  int res3 = 0 ;
18321  PyObject * obj0 = 0 ;
18322  PyObject * obj1 = 0 ;
18323  PyObject * obj2 = 0 ;
18324 
18325  if (!PyArg_ParseTuple(args,(char *)"OOO:Index_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail;
18326  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18327  if (!SWIG_IsOK(res1)) {
18328  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'");
18329  }
18330  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18331  ecode2 = SWIG_AsVal_long(obj1, &val2);
18332  if (!SWIG_IsOK(ecode2)) {
18333  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
18334  }
18335  arg2 = static_cast< faiss::Index::idx_t >(val2);
18336  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
18337  if (!SWIG_IsOK(res3)) {
18338  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_reconstruct" "', argument " "3"" of type '" "float *""'");
18339  }
18340  arg3 = reinterpret_cast< float * >(argp3);
18341  {
18342  Py_BEGIN_ALLOW_THREADS
18343  try {
18344  ((faiss::Index const *)arg1)->reconstruct(arg2,arg3);
18345  } catch(faiss::FaissException & e) {
18346  PyEval_RestoreThread(_save);
18347 
18348  if (PyErr_Occurred()) {
18349  // some previous code already set the error type.
18350  } else {
18351  PyErr_SetString(PyExc_RuntimeError, e.what());
18352  }
18353  SWIG_fail;
18354  }
18355  Py_END_ALLOW_THREADS
18356  }
18357  resultobj = SWIG_Py_Void();
18358  return resultobj;
18359 fail:
18360  return NULL;
18361 }
18362 
18363 
18364 SWIGINTERN PyObject *_wrap_Index_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18365  PyObject *resultobj = 0;
18366  faiss::Index *arg1 = (faiss::Index *) 0 ;
18367  faiss::Index::idx_t arg2 ;
18368  faiss::Index::idx_t arg3 ;
18369  float *arg4 = (float *) 0 ;
18370  void *argp1 = 0 ;
18371  int res1 = 0 ;
18372  long val2 ;
18373  int ecode2 = 0 ;
18374  long val3 ;
18375  int ecode3 = 0 ;
18376  void *argp4 = 0 ;
18377  int res4 = 0 ;
18378  PyObject * obj0 = 0 ;
18379  PyObject * obj1 = 0 ;
18380  PyObject * obj2 = 0 ;
18381  PyObject * obj3 = 0 ;
18382 
18383  if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
18384  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18385  if (!SWIG_IsOK(res1)) {
18386  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_reconstruct_n" "', argument " "1"" of type '" "faiss::Index const *""'");
18387  }
18388  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18389  ecode2 = SWIG_AsVal_long(obj1, &val2);
18390  if (!SWIG_IsOK(ecode2)) {
18391  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
18392  }
18393  arg2 = static_cast< faiss::Index::idx_t >(val2);
18394  ecode3 = SWIG_AsVal_long(obj2, &val3);
18395  if (!SWIG_IsOK(ecode3)) {
18396  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Index_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'");
18397  }
18398  arg3 = static_cast< faiss::Index::idx_t >(val3);
18399  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
18400  if (!SWIG_IsOK(res4)) {
18401  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Index_reconstruct_n" "', argument " "4"" of type '" "float *""'");
18402  }
18403  arg4 = reinterpret_cast< float * >(argp4);
18404  {
18405  Py_BEGIN_ALLOW_THREADS
18406  try {
18407  ((faiss::Index const *)arg1)->reconstruct_n(arg2,arg3,arg4);
18408  } catch(faiss::FaissException & e) {
18409  PyEval_RestoreThread(_save);
18410 
18411  if (PyErr_Occurred()) {
18412  // some previous code already set the error type.
18413  } else {
18414  PyErr_SetString(PyExc_RuntimeError, e.what());
18415  }
18416  SWIG_fail;
18417  }
18418  Py_END_ALLOW_THREADS
18419  }
18420  resultobj = SWIG_Py_Void();
18421  return resultobj;
18422 fail:
18423  return NULL;
18424 }
18425 
18426 
18427 SWIGINTERN PyObject *_wrap_Index_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18428  PyObject *resultobj = 0;
18429  faiss::Index *arg1 = (faiss::Index *) 0 ;
18430  faiss::Index::idx_t arg2 ;
18431  float *arg3 = (float *) 0 ;
18432  faiss::Index::idx_t arg4 ;
18433  float *arg5 = (float *) 0 ;
18435  float *arg7 = (float *) 0 ;
18436  void *argp1 = 0 ;
18437  int res1 = 0 ;
18438  long val2 ;
18439  int ecode2 = 0 ;
18440  void *argp3 = 0 ;
18441  int res3 = 0 ;
18442  long val4 ;
18443  int ecode4 = 0 ;
18444  void *argp5 = 0 ;
18445  int res5 = 0 ;
18446  void *argp6 = 0 ;
18447  int res6 = 0 ;
18448  void *argp7 = 0 ;
18449  int res7 = 0 ;
18450  PyObject * obj0 = 0 ;
18451  PyObject * obj1 = 0 ;
18452  PyObject * obj2 = 0 ;
18453  PyObject * obj3 = 0 ;
18454  PyObject * obj4 = 0 ;
18455  PyObject * obj5 = 0 ;
18456  PyObject * obj6 = 0 ;
18457 
18458  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Index_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
18459  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18460  if (!SWIG_IsOK(res1)) {
18461  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_search_and_reconstruct" "', argument " "1"" of type '" "faiss::Index const *""'");
18462  }
18463  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18464  ecode2 = SWIG_AsVal_long(obj1, &val2);
18465  if (!SWIG_IsOK(ecode2)) {
18466  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Index_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
18467  }
18468  arg2 = static_cast< faiss::Index::idx_t >(val2);
18469  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
18470  if (!SWIG_IsOK(res3)) {
18471  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'");
18472  }
18473  arg3 = reinterpret_cast< float * >(argp3);
18474  ecode4 = SWIG_AsVal_long(obj3, &val4);
18475  if (!SWIG_IsOK(ecode4)) {
18476  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
18477  }
18478  arg4 = static_cast< faiss::Index::idx_t >(val4);
18479  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
18480  if (!SWIG_IsOK(res5)) {
18481  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Index_search_and_reconstruct" "', argument " "5"" of type '" "float *""'");
18482  }
18483  arg5 = reinterpret_cast< float * >(argp5);
18484  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 );
18485  if (!SWIG_IsOK(res6)) {
18486  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Index_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'");
18487  }
18488  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
18489  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 );
18490  if (!SWIG_IsOK(res7)) {
18491  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Index_search_and_reconstruct" "', argument " "7"" of type '" "float *""'");
18492  }
18493  arg7 = reinterpret_cast< float * >(argp7);
18494  {
18495  Py_BEGIN_ALLOW_THREADS
18496  try {
18497  ((faiss::Index const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7);
18498  } catch(faiss::FaissException & e) {
18499  PyEval_RestoreThread(_save);
18500 
18501  if (PyErr_Occurred()) {
18502  // some previous code already set the error type.
18503  } else {
18504  PyErr_SetString(PyExc_RuntimeError, e.what());
18505  }
18506  SWIG_fail;
18507  }
18508  Py_END_ALLOW_THREADS
18509  }
18510  resultobj = SWIG_Py_Void();
18511  return resultobj;
18512 fail:
18513  return NULL;
18514 }
18515 
18516 
18517 SWIGINTERN PyObject *_wrap_Index_compute_residual(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18518  PyObject *resultobj = 0;
18519  faiss::Index *arg1 = (faiss::Index *) 0 ;
18520  float *arg2 = (float *) 0 ;
18521  float *arg3 = (float *) 0 ;
18522  faiss::Index::idx_t arg4 ;
18523  void *argp1 = 0 ;
18524  int res1 = 0 ;
18525  void *argp2 = 0 ;
18526  int res2 = 0 ;
18527  void *argp3 = 0 ;
18528  int res3 = 0 ;
18529  long val4 ;
18530  int ecode4 = 0 ;
18531  PyObject * obj0 = 0 ;
18532  PyObject * obj1 = 0 ;
18533  PyObject * obj2 = 0 ;
18534  PyObject * obj3 = 0 ;
18535 
18536  if (!PyArg_ParseTuple(args,(char *)"OOOO:Index_compute_residual",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
18537  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18538  if (!SWIG_IsOK(res1)) {
18539  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_compute_residual" "', argument " "1"" of type '" "faiss::Index const *""'");
18540  }
18541  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18542  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
18543  if (!SWIG_IsOK(res2)) {
18544  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Index_compute_residual" "', argument " "2"" of type '" "float const *""'");
18545  }
18546  arg2 = reinterpret_cast< float * >(argp2);
18547  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
18548  if (!SWIG_IsOK(res3)) {
18549  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Index_compute_residual" "', argument " "3"" of type '" "float *""'");
18550  }
18551  arg3 = reinterpret_cast< float * >(argp3);
18552  ecode4 = SWIG_AsVal_long(obj3, &val4);
18553  if (!SWIG_IsOK(ecode4)) {
18554  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Index_compute_residual" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
18555  }
18556  arg4 = static_cast< faiss::Index::idx_t >(val4);
18557  {
18558  Py_BEGIN_ALLOW_THREADS
18559  try {
18560  ((faiss::Index const *)arg1)->compute_residual((float const *)arg2,arg3,arg4);
18561  } catch(faiss::FaissException & e) {
18562  PyEval_RestoreThread(_save);
18563 
18564  if (PyErr_Occurred()) {
18565  // some previous code already set the error type.
18566  } else {
18567  PyErr_SetString(PyExc_RuntimeError, e.what());
18568  }
18569  SWIG_fail;
18570  }
18571  Py_END_ALLOW_THREADS
18572  }
18573  resultobj = SWIG_Py_Void();
18574  return resultobj;
18575 fail:
18576  return NULL;
18577 }
18578 
18579 
18580 SWIGINTERN PyObject *_wrap_Index_display(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18581  PyObject *resultobj = 0;
18582  faiss::Index *arg1 = (faiss::Index *) 0 ;
18583  void *argp1 = 0 ;
18584  int res1 = 0 ;
18585  PyObject * obj0 = 0 ;
18586 
18587  if (!PyArg_ParseTuple(args,(char *)"O:Index_display",&obj0)) SWIG_fail;
18588  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
18589  if (!SWIG_IsOK(res1)) {
18590  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Index_display" "', argument " "1"" of type '" "faiss::Index const *""'");
18591  }
18592  arg1 = reinterpret_cast< faiss::Index * >(argp1);
18593  {
18594  Py_BEGIN_ALLOW_THREADS
18595  try {
18596  ((faiss::Index const *)arg1)->display();
18597  } catch(faiss::FaissException & e) {
18598  PyEval_RestoreThread(_save);
18599 
18600  if (PyErr_Occurred()) {
18601  // some previous code already set the error type.
18602  } else {
18603  PyErr_SetString(PyExc_RuntimeError, e.what());
18604  }
18605  SWIG_fail;
18606  }
18607  Py_END_ALLOW_THREADS
18608  }
18609  resultobj = SWIG_Py_Void();
18610  return resultobj;
18611 fail:
18612  return NULL;
18613 }
18614 
18615 
18616 SWIGINTERN PyObject *Index_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18617  PyObject *obj;
18618  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
18619  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Index, SWIG_NewClientData(obj));
18620  return SWIG_Py_Void();
18621 }
18622 
18623 SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18624  PyObject *resultobj = 0;
18626  int arg2 ;
18627  void *argp1 = 0 ;
18628  int res1 = 0 ;
18629  int val2 ;
18630  int ecode2 = 0 ;
18631  PyObject * obj0 = 0 ;
18632  PyObject * obj1 = 0 ;
18633 
18634  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_niter_set",&obj0,&obj1)) SWIG_fail;
18635  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18636  if (!SWIG_IsOK(res1)) {
18637  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18638  }
18639  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18640  ecode2 = SWIG_AsVal_int(obj1, &val2);
18641  if (!SWIG_IsOK(ecode2)) {
18642  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_niter_set" "', argument " "2"" of type '" "int""'");
18643  }
18644  arg2 = static_cast< int >(val2);
18645  if (arg1) (arg1)->niter = arg2;
18646  resultobj = SWIG_Py_Void();
18647  return resultobj;
18648 fail:
18649  return NULL;
18650 }
18651 
18652 
18653 SWIGINTERN PyObject *_wrap_ClusteringParameters_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18654  PyObject *resultobj = 0;
18656  void *argp1 = 0 ;
18657  int res1 = 0 ;
18658  PyObject * obj0 = 0 ;
18659  int result;
18660 
18661  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_niter_get",&obj0)) SWIG_fail;
18662  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18663  if (!SWIG_IsOK(res1)) {
18664  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_niter_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18665  }
18666  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18667  result = (int) ((arg1)->niter);
18668  resultobj = SWIG_From_int(static_cast< int >(result));
18669  return resultobj;
18670 fail:
18671  return NULL;
18672 }
18673 
18674 
18675 SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18676  PyObject *resultobj = 0;
18678  int arg2 ;
18679  void *argp1 = 0 ;
18680  int res1 = 0 ;
18681  int val2 ;
18682  int ecode2 = 0 ;
18683  PyObject * obj0 = 0 ;
18684  PyObject * obj1 = 0 ;
18685 
18686  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_nredo_set",&obj0,&obj1)) SWIG_fail;
18687  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18688  if (!SWIG_IsOK(res1)) {
18689  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18690  }
18691  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18692  ecode2 = SWIG_AsVal_int(obj1, &val2);
18693  if (!SWIG_IsOK(ecode2)) {
18694  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_nredo_set" "', argument " "2"" of type '" "int""'");
18695  }
18696  arg2 = static_cast< int >(val2);
18697  if (arg1) (arg1)->nredo = arg2;
18698  resultobj = SWIG_Py_Void();
18699  return resultobj;
18700 fail:
18701  return NULL;
18702 }
18703 
18704 
18705 SWIGINTERN PyObject *_wrap_ClusteringParameters_nredo_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18706  PyObject *resultobj = 0;
18708  void *argp1 = 0 ;
18709  int res1 = 0 ;
18710  PyObject * obj0 = 0 ;
18711  int result;
18712 
18713  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_nredo_get",&obj0)) SWIG_fail;
18714  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18715  if (!SWIG_IsOK(res1)) {
18716  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_nredo_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18717  }
18718  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18719  result = (int) ((arg1)->nredo);
18720  resultobj = SWIG_From_int(static_cast< int >(result));
18721  return resultobj;
18722 fail:
18723  return NULL;
18724 }
18725 
18726 
18727 SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18728  PyObject *resultobj = 0;
18730  bool arg2 ;
18731  void *argp1 = 0 ;
18732  int res1 = 0 ;
18733  bool val2 ;
18734  int ecode2 = 0 ;
18735  PyObject * obj0 = 0 ;
18736  PyObject * obj1 = 0 ;
18737 
18738  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_verbose_set",&obj0,&obj1)) SWIG_fail;
18739  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18740  if (!SWIG_IsOK(res1)) {
18741  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18742  }
18743  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18744  ecode2 = SWIG_AsVal_bool(obj1, &val2);
18745  if (!SWIG_IsOK(ecode2)) {
18746  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_verbose_set" "', argument " "2"" of type '" "bool""'");
18747  }
18748  arg2 = static_cast< bool >(val2);
18749  if (arg1) (arg1)->verbose = arg2;
18750  resultobj = SWIG_Py_Void();
18751  return resultobj;
18752 fail:
18753  return NULL;
18754 }
18755 
18756 
18757 SWIGINTERN PyObject *_wrap_ClusteringParameters_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18758  PyObject *resultobj = 0;
18760  void *argp1 = 0 ;
18761  int res1 = 0 ;
18762  PyObject * obj0 = 0 ;
18763  bool result;
18764 
18765  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_verbose_get",&obj0)) SWIG_fail;
18766  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18767  if (!SWIG_IsOK(res1)) {
18768  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_verbose_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18769  }
18770  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18771  result = (bool) ((arg1)->verbose);
18772  resultobj = SWIG_From_bool(static_cast< bool >(result));
18773  return resultobj;
18774 fail:
18775  return NULL;
18776 }
18777 
18778 
18779 SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18780  PyObject *resultobj = 0;
18782  bool arg2 ;
18783  void *argp1 = 0 ;
18784  int res1 = 0 ;
18785  bool val2 ;
18786  int ecode2 = 0 ;
18787  PyObject * obj0 = 0 ;
18788  PyObject * obj1 = 0 ;
18789 
18790  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_spherical_set",&obj0,&obj1)) SWIG_fail;
18791  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18792  if (!SWIG_IsOK(res1)) {
18793  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18794  }
18795  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18796  ecode2 = SWIG_AsVal_bool(obj1, &val2);
18797  if (!SWIG_IsOK(ecode2)) {
18798  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_spherical_set" "', argument " "2"" of type '" "bool""'");
18799  }
18800  arg2 = static_cast< bool >(val2);
18801  if (arg1) (arg1)->spherical = arg2;
18802  resultobj = SWIG_Py_Void();
18803  return resultobj;
18804 fail:
18805  return NULL;
18806 }
18807 
18808 
18809 SWIGINTERN PyObject *_wrap_ClusteringParameters_spherical_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18810  PyObject *resultobj = 0;
18812  void *argp1 = 0 ;
18813  int res1 = 0 ;
18814  PyObject * obj0 = 0 ;
18815  bool result;
18816 
18817  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_spherical_get",&obj0)) SWIG_fail;
18818  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18819  if (!SWIG_IsOK(res1)) {
18820  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_spherical_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18821  }
18822  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18823  result = (bool) ((arg1)->spherical);
18824  resultobj = SWIG_From_bool(static_cast< bool >(result));
18825  return resultobj;
18826 fail:
18827  return NULL;
18828 }
18829 
18830 
18831 SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18832  PyObject *resultobj = 0;
18834  bool arg2 ;
18835  void *argp1 = 0 ;
18836  int res1 = 0 ;
18837  bool val2 ;
18838  int ecode2 = 0 ;
18839  PyObject * obj0 = 0 ;
18840  PyObject * obj1 = 0 ;
18841 
18842  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_int_centroids_set",&obj0,&obj1)) SWIG_fail;
18843  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18844  if (!SWIG_IsOK(res1)) {
18845  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18846  }
18847  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18848  ecode2 = SWIG_AsVal_bool(obj1, &val2);
18849  if (!SWIG_IsOK(ecode2)) {
18850  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_int_centroids_set" "', argument " "2"" of type '" "bool""'");
18851  }
18852  arg2 = static_cast< bool >(val2);
18853  if (arg1) (arg1)->int_centroids = arg2;
18854  resultobj = SWIG_Py_Void();
18855  return resultobj;
18856 fail:
18857  return NULL;
18858 }
18859 
18860 
18861 SWIGINTERN PyObject *_wrap_ClusteringParameters_int_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18862  PyObject *resultobj = 0;
18864  void *argp1 = 0 ;
18865  int res1 = 0 ;
18866  PyObject * obj0 = 0 ;
18867  bool result;
18868 
18869  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_int_centroids_get",&obj0)) SWIG_fail;
18870  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18871  if (!SWIG_IsOK(res1)) {
18872  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_int_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18873  }
18874  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18875  result = (bool) ((arg1)->int_centroids);
18876  resultobj = SWIG_From_bool(static_cast< bool >(result));
18877  return resultobj;
18878 fail:
18879  return NULL;
18880 }
18881 
18882 
18883 SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18884  PyObject *resultobj = 0;
18886  bool arg2 ;
18887  void *argp1 = 0 ;
18888  int res1 = 0 ;
18889  bool val2 ;
18890  int ecode2 = 0 ;
18891  PyObject * obj0 = 0 ;
18892  PyObject * obj1 = 0 ;
18893 
18894  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_update_index_set",&obj0,&obj1)) SWIG_fail;
18895  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18896  if (!SWIG_IsOK(res1)) {
18897  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18898  }
18899  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18900  ecode2 = SWIG_AsVal_bool(obj1, &val2);
18901  if (!SWIG_IsOK(ecode2)) {
18902  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_update_index_set" "', argument " "2"" of type '" "bool""'");
18903  }
18904  arg2 = static_cast< bool >(val2);
18905  if (arg1) (arg1)->update_index = arg2;
18906  resultobj = SWIG_Py_Void();
18907  return resultobj;
18908 fail:
18909  return NULL;
18910 }
18911 
18912 
18913 SWIGINTERN PyObject *_wrap_ClusteringParameters_update_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18914  PyObject *resultobj = 0;
18916  void *argp1 = 0 ;
18917  int res1 = 0 ;
18918  PyObject * obj0 = 0 ;
18919  bool result;
18920 
18921  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_update_index_get",&obj0)) SWIG_fail;
18922  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18923  if (!SWIG_IsOK(res1)) {
18924  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_update_index_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18925  }
18926  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18927  result = (bool) ((arg1)->update_index);
18928  resultobj = SWIG_From_bool(static_cast< bool >(result));
18929  return resultobj;
18930 fail:
18931  return NULL;
18932 }
18933 
18934 
18935 SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18936  PyObject *resultobj = 0;
18938  bool arg2 ;
18939  void *argp1 = 0 ;
18940  int res1 = 0 ;
18941  bool val2 ;
18942  int ecode2 = 0 ;
18943  PyObject * obj0 = 0 ;
18944  PyObject * obj1 = 0 ;
18945 
18946  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_frozen_centroids_set",&obj0,&obj1)) SWIG_fail;
18947  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18948  if (!SWIG_IsOK(res1)) {
18949  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18950  }
18951  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18952  ecode2 = SWIG_AsVal_bool(obj1, &val2);
18953  if (!SWIG_IsOK(ecode2)) {
18954  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_frozen_centroids_set" "', argument " "2"" of type '" "bool""'");
18955  }
18956  arg2 = static_cast< bool >(val2);
18957  if (arg1) (arg1)->frozen_centroids = arg2;
18958  resultobj = SWIG_Py_Void();
18959  return resultobj;
18960 fail:
18961  return NULL;
18962 }
18963 
18964 
18965 SWIGINTERN PyObject *_wrap_ClusteringParameters_frozen_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18966  PyObject *resultobj = 0;
18968  void *argp1 = 0 ;
18969  int res1 = 0 ;
18970  PyObject * obj0 = 0 ;
18971  bool result;
18972 
18973  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_frozen_centroids_get",&obj0)) SWIG_fail;
18974  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
18975  if (!SWIG_IsOK(res1)) {
18976  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_frozen_centroids_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
18977  }
18978  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
18979  result = (bool) ((arg1)->frozen_centroids);
18980  resultobj = SWIG_From_bool(static_cast< bool >(result));
18981  return resultobj;
18982 fail:
18983  return NULL;
18984 }
18985 
18986 
18987 SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18988  PyObject *resultobj = 0;
18990  int arg2 ;
18991  void *argp1 = 0 ;
18992  int res1 = 0 ;
18993  int val2 ;
18994  int ecode2 = 0 ;
18995  PyObject * obj0 = 0 ;
18996  PyObject * obj1 = 0 ;
18997 
18998  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_min_points_per_centroid_set",&obj0,&obj1)) SWIG_fail;
18999  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19000  if (!SWIG_IsOK(res1)) {
19001  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19002  }
19003  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19004  ecode2 = SWIG_AsVal_int(obj1, &val2);
19005  if (!SWIG_IsOK(ecode2)) {
19006  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_min_points_per_centroid_set" "', argument " "2"" of type '" "int""'");
19007  }
19008  arg2 = static_cast< int >(val2);
19009  if (arg1) (arg1)->min_points_per_centroid = arg2;
19010  resultobj = SWIG_Py_Void();
19011  return resultobj;
19012 fail:
19013  return NULL;
19014 }
19015 
19016 
19017 SWIGINTERN PyObject *_wrap_ClusteringParameters_min_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19018  PyObject *resultobj = 0;
19020  void *argp1 = 0 ;
19021  int res1 = 0 ;
19022  PyObject * obj0 = 0 ;
19023  int result;
19024 
19025  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_min_points_per_centroid_get",&obj0)) SWIG_fail;
19026  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19027  if (!SWIG_IsOK(res1)) {
19028  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_min_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19029  }
19030  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19031  result = (int) ((arg1)->min_points_per_centroid);
19032  resultobj = SWIG_From_int(static_cast< int >(result));
19033  return resultobj;
19034 fail:
19035  return NULL;
19036 }
19037 
19038 
19039 SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19040  PyObject *resultobj = 0;
19042  int arg2 ;
19043  void *argp1 = 0 ;
19044  int res1 = 0 ;
19045  int val2 ;
19046  int ecode2 = 0 ;
19047  PyObject * obj0 = 0 ;
19048  PyObject * obj1 = 0 ;
19049 
19050  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_max_points_per_centroid_set",&obj0,&obj1)) SWIG_fail;
19051  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19052  if (!SWIG_IsOK(res1)) {
19053  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19054  }
19055  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19056  ecode2 = SWIG_AsVal_int(obj1, &val2);
19057  if (!SWIG_IsOK(ecode2)) {
19058  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_max_points_per_centroid_set" "', argument " "2"" of type '" "int""'");
19059  }
19060  arg2 = static_cast< int >(val2);
19061  if (arg1) (arg1)->max_points_per_centroid = arg2;
19062  resultobj = SWIG_Py_Void();
19063  return resultobj;
19064 fail:
19065  return NULL;
19066 }
19067 
19068 
19069 SWIGINTERN PyObject *_wrap_ClusteringParameters_max_points_per_centroid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19070  PyObject *resultobj = 0;
19072  void *argp1 = 0 ;
19073  int res1 = 0 ;
19074  PyObject * obj0 = 0 ;
19075  int result;
19076 
19077  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_max_points_per_centroid_get",&obj0)) SWIG_fail;
19078  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19079  if (!SWIG_IsOK(res1)) {
19080  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_max_points_per_centroid_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19081  }
19082  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19083  result = (int) ((arg1)->max_points_per_centroid);
19084  resultobj = SWIG_From_int(static_cast< int >(result));
19085  return resultobj;
19086 fail:
19087  return NULL;
19088 }
19089 
19090 
19091 SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19092  PyObject *resultobj = 0;
19094  int arg2 ;
19095  void *argp1 = 0 ;
19096  int res1 = 0 ;
19097  int val2 ;
19098  int ecode2 = 0 ;
19099  PyObject * obj0 = 0 ;
19100  PyObject * obj1 = 0 ;
19101 
19102  if (!PyArg_ParseTuple(args,(char *)"OO:ClusteringParameters_seed_set",&obj0,&obj1)) SWIG_fail;
19103  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19104  if (!SWIG_IsOK(res1)) {
19105  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_set" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19106  }
19107  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19108  ecode2 = SWIG_AsVal_int(obj1, &val2);
19109  if (!SWIG_IsOK(ecode2)) {
19110  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ClusteringParameters_seed_set" "', argument " "2"" of type '" "int""'");
19111  }
19112  arg2 = static_cast< int >(val2);
19113  if (arg1) (arg1)->seed = arg2;
19114  resultobj = SWIG_Py_Void();
19115  return resultobj;
19116 fail:
19117  return NULL;
19118 }
19119 
19120 
19121 SWIGINTERN PyObject *_wrap_ClusteringParameters_seed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19122  PyObject *resultobj = 0;
19124  void *argp1 = 0 ;
19125  int res1 = 0 ;
19126  PyObject * obj0 = 0 ;
19127  int result;
19128 
19129  if (!PyArg_ParseTuple(args,(char *)"O:ClusteringParameters_seed_get",&obj0)) SWIG_fail;
19130  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
19131  if (!SWIG_IsOK(res1)) {
19132  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ClusteringParameters_seed_get" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19133  }
19134  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19135  result = (int) ((arg1)->seed);
19136  resultobj = SWIG_From_int(static_cast< int >(result));
19137  return resultobj;
19138 fail:
19139  return NULL;
19140 }
19141 
19142 
19143 SWIGINTERN PyObject *_wrap_new_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19144  PyObject *resultobj = 0;
19145  faiss::ClusteringParameters *result = 0 ;
19146 
19147  if (!PyArg_ParseTuple(args,(char *)":new_ClusteringParameters")) SWIG_fail;
19148  {
19149  Py_BEGIN_ALLOW_THREADS
19150  try {
19152  } catch(faiss::FaissException & e) {
19153  PyEval_RestoreThread(_save);
19154 
19155  if (PyErr_Occurred()) {
19156  // some previous code already set the error type.
19157  } else {
19158  PyErr_SetString(PyExc_RuntimeError, e.what());
19159  }
19160  SWIG_fail;
19161  }
19162  Py_END_ALLOW_THREADS
19163  }
19164  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_NEW | 0 );
19165  return resultobj;
19166 fail:
19167  return NULL;
19168 }
19169 
19170 
19171 SWIGINTERN PyObject *_wrap_delete_ClusteringParameters(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19172  PyObject *resultobj = 0;
19174  void *argp1 = 0 ;
19175  int res1 = 0 ;
19176  PyObject * obj0 = 0 ;
19177 
19178  if (!PyArg_ParseTuple(args,(char *)"O:delete_ClusteringParameters",&obj0)) SWIG_fail;
19179  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ClusteringParameters, SWIG_POINTER_DISOWN | 0 );
19180  if (!SWIG_IsOK(res1)) {
19181  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ClusteringParameters" "', argument " "1"" of type '" "faiss::ClusteringParameters *""'");
19182  }
19183  arg1 = reinterpret_cast< faiss::ClusteringParameters * >(argp1);
19184  delete arg1;
19185  resultobj = SWIG_Py_Void();
19186  return resultobj;
19187 fail:
19188  return NULL;
19189 }
19190 
19191 
19192 SWIGINTERN PyObject *ClusteringParameters_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19193  PyObject *obj;
19194  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
19195  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ClusteringParameters, SWIG_NewClientData(obj));
19196  return SWIG_Py_Void();
19197 }
19198 
19199 SWIGINTERN PyObject *_wrap_Clustering_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19200  PyObject *resultobj = 0;
19201  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19202  size_t arg2 ;
19203  void *argp1 = 0 ;
19204  int res1 = 0 ;
19205  size_t val2 ;
19206  int ecode2 = 0 ;
19207  PyObject * obj0 = 0 ;
19208  PyObject * obj1 = 0 ;
19209 
19210  if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_d_set",&obj0,&obj1)) SWIG_fail;
19211  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19212  if (!SWIG_IsOK(res1)) {
19213  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_set" "', argument " "1"" of type '" "faiss::Clustering *""'");
19214  }
19215  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19216  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19217  if (!SWIG_IsOK(ecode2)) {
19218  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_d_set" "', argument " "2"" of type '" "size_t""'");
19219  }
19220  arg2 = static_cast< size_t >(val2);
19221  if (arg1) (arg1)->d = arg2;
19222  resultobj = SWIG_Py_Void();
19223  return resultobj;
19224 fail:
19225  return NULL;
19226 }
19227 
19228 
19229 SWIGINTERN PyObject *_wrap_Clustering_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19230  PyObject *resultobj = 0;
19231  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19232  void *argp1 = 0 ;
19233  int res1 = 0 ;
19234  PyObject * obj0 = 0 ;
19235  size_t result;
19236 
19237  if (!PyArg_ParseTuple(args,(char *)"O:Clustering_d_get",&obj0)) SWIG_fail;
19238  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19239  if (!SWIG_IsOK(res1)) {
19240  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_d_get" "', argument " "1"" of type '" "faiss::Clustering *""'");
19241  }
19242  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19243  result = (size_t) ((arg1)->d);
19244  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19245  return resultobj;
19246 fail:
19247  return NULL;
19248 }
19249 
19250 
19251 SWIGINTERN PyObject *_wrap_Clustering_k_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19252  PyObject *resultobj = 0;
19253  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19254  size_t arg2 ;
19255  void *argp1 = 0 ;
19256  int res1 = 0 ;
19257  size_t val2 ;
19258  int ecode2 = 0 ;
19259  PyObject * obj0 = 0 ;
19260  PyObject * obj1 = 0 ;
19261 
19262  if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_k_set",&obj0,&obj1)) SWIG_fail;
19263  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19264  if (!SWIG_IsOK(res1)) {
19265  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_set" "', argument " "1"" of type '" "faiss::Clustering *""'");
19266  }
19267  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19268  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19269  if (!SWIG_IsOK(ecode2)) {
19270  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_k_set" "', argument " "2"" of type '" "size_t""'");
19271  }
19272  arg2 = static_cast< size_t >(val2);
19273  if (arg1) (arg1)->k = arg2;
19274  resultobj = SWIG_Py_Void();
19275  return resultobj;
19276 fail:
19277  return NULL;
19278 }
19279 
19280 
19281 SWIGINTERN PyObject *_wrap_Clustering_k_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19282  PyObject *resultobj = 0;
19283  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19284  void *argp1 = 0 ;
19285  int res1 = 0 ;
19286  PyObject * obj0 = 0 ;
19287  size_t result;
19288 
19289  if (!PyArg_ParseTuple(args,(char *)"O:Clustering_k_get",&obj0)) SWIG_fail;
19290  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19291  if (!SWIG_IsOK(res1)) {
19292  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_k_get" "', argument " "1"" of type '" "faiss::Clustering *""'");
19293  }
19294  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19295  result = (size_t) ((arg1)->k);
19296  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19297  return resultobj;
19298 fail:
19299  return NULL;
19300 }
19301 
19302 
19303 SWIGINTERN PyObject *_wrap_Clustering_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19304  PyObject *resultobj = 0;
19305  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19306  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
19307  void *argp1 = 0 ;
19308  int res1 = 0 ;
19309  void *argp2 = 0 ;
19310  int res2 = 0 ;
19311  PyObject * obj0 = 0 ;
19312  PyObject * obj1 = 0 ;
19313 
19314  if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_centroids_set",&obj0,&obj1)) SWIG_fail;
19315  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19316  if (!SWIG_IsOK(res1)) {
19317  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_set" "', argument " "1"" of type '" "faiss::Clustering *""'");
19318  }
19319  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19320  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
19321  if (!SWIG_IsOK(res2)) {
19322  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'");
19323  }
19324  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
19325  if (arg1) (arg1)->centroids = *arg2;
19326  resultobj = SWIG_Py_Void();
19327  return resultobj;
19328 fail:
19329  return NULL;
19330 }
19331 
19332 
19333 SWIGINTERN PyObject *_wrap_Clustering_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19334  PyObject *resultobj = 0;
19335  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19336  void *argp1 = 0 ;
19337  int res1 = 0 ;
19338  PyObject * obj0 = 0 ;
19339  std::vector< float > *result = 0 ;
19340 
19341  if (!PyArg_ParseTuple(args,(char *)"O:Clustering_centroids_get",&obj0)) SWIG_fail;
19342  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19343  if (!SWIG_IsOK(res1)) {
19344  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_centroids_get" "', argument " "1"" of type '" "faiss::Clustering *""'");
19345  }
19346  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19347  result = (std::vector< float > *)& ((arg1)->centroids);
19348  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
19349  return resultobj;
19350 fail:
19351  return NULL;
19352 }
19353 
19354 
19355 SWIGINTERN PyObject *_wrap_Clustering_obj_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19356  PyObject *resultobj = 0;
19357  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19358  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
19359  void *argp1 = 0 ;
19360  int res1 = 0 ;
19361  void *argp2 = 0 ;
19362  int res2 = 0 ;
19363  PyObject * obj0 = 0 ;
19364  PyObject * obj1 = 0 ;
19365 
19366  if (!PyArg_ParseTuple(args,(char *)"OO:Clustering_obj_set",&obj0,&obj1)) SWIG_fail;
19367  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19368  if (!SWIG_IsOK(res1)) {
19369  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_set" "', argument " "1"" of type '" "faiss::Clustering *""'");
19370  }
19371  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19372  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
19373  if (!SWIG_IsOK(res2)) {
19374  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Clustering_obj_set" "', argument " "2"" of type '" "std::vector< float > *""'");
19375  }
19376  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
19377  if (arg1) (arg1)->obj = *arg2;
19378  resultobj = SWIG_Py_Void();
19379  return resultobj;
19380 fail:
19381  return NULL;
19382 }
19383 
19384 
19385 SWIGINTERN PyObject *_wrap_Clustering_obj_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19386  PyObject *resultobj = 0;
19387  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19388  void *argp1 = 0 ;
19389  int res1 = 0 ;
19390  PyObject * obj0 = 0 ;
19391  std::vector< float > *result = 0 ;
19392 
19393  if (!PyArg_ParseTuple(args,(char *)"O:Clustering_obj_get",&obj0)) SWIG_fail;
19394  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19395  if (!SWIG_IsOK(res1)) {
19396  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_obj_get" "', argument " "1"" of type '" "faiss::Clustering *""'");
19397  }
19398  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19399  result = (std::vector< float > *)& ((arg1)->obj);
19400  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
19401  return resultobj;
19402 fail:
19403  return NULL;
19404 }
19405 
19406 
19407 SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19408  PyObject *resultobj = 0;
19409  int arg1 ;
19410  int arg2 ;
19411  int val1 ;
19412  int ecode1 = 0 ;
19413  int val2 ;
19414  int ecode2 = 0 ;
19415  PyObject * obj0 = 0 ;
19416  PyObject * obj1 = 0 ;
19417  faiss::Clustering *result = 0 ;
19418 
19419  if (!PyArg_ParseTuple(args,(char *)"OO:new_Clustering",&obj0,&obj1)) SWIG_fail;
19420  ecode1 = SWIG_AsVal_int(obj0, &val1);
19421  if (!SWIG_IsOK(ecode1)) {
19422  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'");
19423  }
19424  arg1 = static_cast< int >(val1);
19425  ecode2 = SWIG_AsVal_int(obj1, &val2);
19426  if (!SWIG_IsOK(ecode2)) {
19427  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'");
19428  }
19429  arg2 = static_cast< int >(val2);
19430  {
19431  Py_BEGIN_ALLOW_THREADS
19432  try {
19433  result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2);
19434  } catch(faiss::FaissException & e) {
19435  PyEval_RestoreThread(_save);
19436 
19437  if (PyErr_Occurred()) {
19438  // some previous code already set the error type.
19439  } else {
19440  PyErr_SetString(PyExc_RuntimeError, e.what());
19441  }
19442  SWIG_fail;
19443  }
19444  Py_END_ALLOW_THREADS
19445  }
19446  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 );
19447  return resultobj;
19448 fail:
19449  return NULL;
19450 }
19451 
19452 
19453 SWIGINTERN PyObject *_wrap_new_Clustering__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19454  PyObject *resultobj = 0;
19455  int arg1 ;
19456  int arg2 ;
19457  faiss::ClusteringParameters *arg3 = 0 ;
19458  int val1 ;
19459  int ecode1 = 0 ;
19460  int val2 ;
19461  int ecode2 = 0 ;
19462  void *argp3 = 0 ;
19463  int res3 = 0 ;
19464  PyObject * obj0 = 0 ;
19465  PyObject * obj1 = 0 ;
19466  PyObject * obj2 = 0 ;
19467  faiss::Clustering *result = 0 ;
19468 
19469  if (!PyArg_ParseTuple(args,(char *)"OOO:new_Clustering",&obj0,&obj1,&obj2)) SWIG_fail;
19470  ecode1 = SWIG_AsVal_int(obj0, &val1);
19471  if (!SWIG_IsOK(ecode1)) {
19472  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Clustering" "', argument " "1"" of type '" "int""'");
19473  }
19474  arg1 = static_cast< int >(val1);
19475  ecode2 = SWIG_AsVal_int(obj1, &val2);
19476  if (!SWIG_IsOK(ecode2)) {
19477  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Clustering" "', argument " "2"" of type '" "int""'");
19478  }
19479  arg2 = static_cast< int >(val2);
19480  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0);
19481  if (!SWIG_IsOK(res3)) {
19482  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'");
19483  }
19484  if (!argp3) {
19485  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Clustering" "', argument " "3"" of type '" "faiss::ClusteringParameters const &""'");
19486  }
19487  arg3 = reinterpret_cast< faiss::ClusteringParameters * >(argp3);
19488  {
19489  Py_BEGIN_ALLOW_THREADS
19490  try {
19491  result = (faiss::Clustering *)new faiss::Clustering(arg1,arg2,(faiss::ClusteringParameters const &)*arg3);
19492  } catch(faiss::FaissException & e) {
19493  PyEval_RestoreThread(_save);
19494 
19495  if (PyErr_Occurred()) {
19496  // some previous code already set the error type.
19497  } else {
19498  PyErr_SetString(PyExc_RuntimeError, e.what());
19499  }
19500  SWIG_fail;
19501  }
19502  Py_END_ALLOW_THREADS
19503  }
19504  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_NEW | 0 );
19505  return resultobj;
19506 fail:
19507  return NULL;
19508 }
19509 
19510 
19511 SWIGINTERN PyObject *_wrap_new_Clustering(PyObject *self, PyObject *args) {
19512  Py_ssize_t argc;
19513  PyObject *argv[4] = {
19514  0
19515  };
19516  Py_ssize_t ii;
19517 
19518  if (!PyTuple_Check(args)) SWIG_fail;
19519  argc = args ? PyObject_Length(args) : 0;
19520  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
19521  argv[ii] = PyTuple_GET_ITEM(args,ii);
19522  }
19523  if (argc == 2) {
19524  int _v;
19525  {
19526  int res = SWIG_AsVal_int(argv[0], NULL);
19527  _v = SWIG_CheckState(res);
19528  }
19529  if (_v) {
19530  {
19531  int res = SWIG_AsVal_int(argv[1], NULL);
19532  _v = SWIG_CheckState(res);
19533  }
19534  if (_v) {
19535  return _wrap_new_Clustering__SWIG_0(self, args);
19536  }
19537  }
19538  }
19539  if (argc == 3) {
19540  int _v;
19541  {
19542  int res = SWIG_AsVal_int(argv[0], NULL);
19543  _v = SWIG_CheckState(res);
19544  }
19545  if (_v) {
19546  {
19547  int res = SWIG_AsVal_int(argv[1], NULL);
19548  _v = SWIG_CheckState(res);
19549  }
19550  if (_v) {
19551  int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_faiss__ClusteringParameters, 0);
19552  _v = SWIG_CheckState(res);
19553  if (_v) {
19554  return _wrap_new_Clustering__SWIG_1(self, args);
19555  }
19556  }
19557  }
19558  }
19559 
19560 fail:
19561  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_Clustering'.\n"
19562  " Possible C/C++ prototypes are:\n"
19563  " faiss::Clustering::Clustering(int,int)\n"
19564  " faiss::Clustering::Clustering(int,int,faiss::ClusteringParameters const &)\n");
19565  return 0;
19566 }
19567 
19568 
19569 SWIGINTERN PyObject *_wrap_Clustering_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19570  PyObject *resultobj = 0;
19571  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19572  faiss::Clustering::idx_t arg2 ;
19573  float *arg3 = (float *) 0 ;
19574  faiss::Index *arg4 = 0 ;
19575  void *argp1 = 0 ;
19576  int res1 = 0 ;
19577  long val2 ;
19578  int ecode2 = 0 ;
19579  void *argp3 = 0 ;
19580  int res3 = 0 ;
19581  void *argp4 = 0 ;
19582  int res4 = 0 ;
19583  PyObject * obj0 = 0 ;
19584  PyObject * obj1 = 0 ;
19585  PyObject * obj2 = 0 ;
19586  PyObject * obj3 = 0 ;
19587 
19588  if (!PyArg_ParseTuple(args,(char *)"OOOO:Clustering_train",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
19589  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19590  if (!SWIG_IsOK(res1)) {
19591  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_train" "', argument " "1"" of type '" "faiss::Clustering *""'");
19592  }
19593  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19594  ecode2 = SWIG_AsVal_long(obj1, &val2);
19595  if (!SWIG_IsOK(ecode2)) {
19596  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Clustering_train" "', argument " "2"" of type '" "faiss::Clustering::idx_t""'");
19597  }
19598  arg2 = static_cast< faiss::Clustering::idx_t >(val2);
19599  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
19600  if (!SWIG_IsOK(res3)) {
19601  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Clustering_train" "', argument " "3"" of type '" "float const *""'");
19602  }
19603  arg3 = reinterpret_cast< float * >(argp3);
19604  res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_faiss__Index, 0 );
19605  if (!SWIG_IsOK(res4)) {
19606  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'");
19607  }
19608  if (!argp4) {
19609  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Clustering_train" "', argument " "4"" of type '" "faiss::Index &""'");
19610  }
19611  arg4 = reinterpret_cast< faiss::Index * >(argp4);
19612  {
19613  Py_BEGIN_ALLOW_THREADS
19614  try {
19615  (arg1)->train(arg2,(float const *)arg3,*arg4);
19616  } catch(faiss::FaissException & e) {
19617  PyEval_RestoreThread(_save);
19618 
19619  if (PyErr_Occurred()) {
19620  // some previous code already set the error type.
19621  } else {
19622  PyErr_SetString(PyExc_RuntimeError, e.what());
19623  }
19624  SWIG_fail;
19625  }
19626  Py_END_ALLOW_THREADS
19627  }
19628  resultobj = SWIG_Py_Void();
19629  return resultobj;
19630 fail:
19631  return NULL;
19632 }
19633 
19634 
19635 SWIGINTERN PyObject *_wrap_Clustering_post_process_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19636  PyObject *resultobj = 0;
19637  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19638  void *argp1 = 0 ;
19639  int res1 = 0 ;
19640  PyObject * obj0 = 0 ;
19641 
19642  if (!PyArg_ParseTuple(args,(char *)"O:Clustering_post_process_centroids",&obj0)) SWIG_fail;
19643  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, 0 | 0 );
19644  if (!SWIG_IsOK(res1)) {
19645  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Clustering_post_process_centroids" "', argument " "1"" of type '" "faiss::Clustering *""'");
19646  }
19647  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19648  {
19649  Py_BEGIN_ALLOW_THREADS
19650  try {
19651  (arg1)->post_process_centroids();
19652  } catch(faiss::FaissException & e) {
19653  PyEval_RestoreThread(_save);
19654 
19655  if (PyErr_Occurred()) {
19656  // some previous code already set the error type.
19657  } else {
19658  PyErr_SetString(PyExc_RuntimeError, e.what());
19659  }
19660  SWIG_fail;
19661  }
19662  Py_END_ALLOW_THREADS
19663  }
19664  resultobj = SWIG_Py_Void();
19665  return resultobj;
19666 fail:
19667  return NULL;
19668 }
19669 
19670 
19671 SWIGINTERN PyObject *_wrap_delete_Clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19672  PyObject *resultobj = 0;
19673  faiss::Clustering *arg1 = (faiss::Clustering *) 0 ;
19674  void *argp1 = 0 ;
19675  int res1 = 0 ;
19676  PyObject * obj0 = 0 ;
19677 
19678  if (!PyArg_ParseTuple(args,(char *)"O:delete_Clustering",&obj0)) SWIG_fail;
19679  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Clustering, SWIG_POINTER_DISOWN | 0 );
19680  if (!SWIG_IsOK(res1)) {
19681  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Clustering" "', argument " "1"" of type '" "faiss::Clustering *""'");
19682  }
19683  arg1 = reinterpret_cast< faiss::Clustering * >(argp1);
19684  {
19685  Py_BEGIN_ALLOW_THREADS
19686  try {
19687  delete arg1;
19688  } catch(faiss::FaissException & e) {
19689  PyEval_RestoreThread(_save);
19690 
19691  if (PyErr_Occurred()) {
19692  // some previous code already set the error type.
19693  } else {
19694  PyErr_SetString(PyExc_RuntimeError, e.what());
19695  }
19696  SWIG_fail;
19697  }
19698  Py_END_ALLOW_THREADS
19699  }
19700  resultobj = SWIG_Py_Void();
19701  return resultobj;
19702 fail:
19703  return NULL;
19704 }
19705 
19706 
19707 SWIGINTERN PyObject *Clustering_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19708  PyObject *obj;
19709  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
19710  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__Clustering, SWIG_NewClientData(obj));
19711  return SWIG_Py_Void();
19712 }
19713 
19714 SWIGINTERN PyObject *_wrap_kmeans_clustering(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19715  PyObject *resultobj = 0;
19716  size_t arg1 ;
19717  size_t arg2 ;
19718  size_t arg3 ;
19719  float *arg4 = (float *) 0 ;
19720  float *arg5 = (float *) 0 ;
19721  size_t val1 ;
19722  int ecode1 = 0 ;
19723  size_t val2 ;
19724  int ecode2 = 0 ;
19725  size_t val3 ;
19726  int ecode3 = 0 ;
19727  void *argp4 = 0 ;
19728  int res4 = 0 ;
19729  void *argp5 = 0 ;
19730  int res5 = 0 ;
19731  PyObject * obj0 = 0 ;
19732  PyObject * obj1 = 0 ;
19733  PyObject * obj2 = 0 ;
19734  PyObject * obj3 = 0 ;
19735  PyObject * obj4 = 0 ;
19736  float result;
19737 
19738  if (!PyArg_ParseTuple(args,(char *)"OOOOO:kmeans_clustering",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
19739  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
19740  if (!SWIG_IsOK(ecode1)) {
19741  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "kmeans_clustering" "', argument " "1"" of type '" "size_t""'");
19742  }
19743  arg1 = static_cast< size_t >(val1);
19744  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19745  if (!SWIG_IsOK(ecode2)) {
19746  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "kmeans_clustering" "', argument " "2"" of type '" "size_t""'");
19747  }
19748  arg2 = static_cast< size_t >(val2);
19749  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
19750  if (!SWIG_IsOK(ecode3)) {
19751  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "kmeans_clustering" "', argument " "3"" of type '" "size_t""'");
19752  }
19753  arg3 = static_cast< size_t >(val3);
19754  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
19755  if (!SWIG_IsOK(res4)) {
19756  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "kmeans_clustering" "', argument " "4"" of type '" "float const *""'");
19757  }
19758  arg4 = reinterpret_cast< float * >(argp4);
19759  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
19760  if (!SWIG_IsOK(res5)) {
19761  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "kmeans_clustering" "', argument " "5"" of type '" "float *""'");
19762  }
19763  arg5 = reinterpret_cast< float * >(argp5);
19764  {
19765  Py_BEGIN_ALLOW_THREADS
19766  try {
19767  result = (float)faiss::kmeans_clustering(arg1,arg2,arg3,(float const *)arg4,arg5);
19768  } catch(faiss::FaissException & e) {
19769  PyEval_RestoreThread(_save);
19770 
19771  if (PyErr_Occurred()) {
19772  // some previous code already set the error type.
19773  } else {
19774  PyErr_SetString(PyExc_RuntimeError, e.what());
19775  }
19776  SWIG_fail;
19777  }
19778  Py_END_ALLOW_THREADS
19779  }
19780  resultobj = SWIG_From_float(static_cast< float >(result));
19781  return resultobj;
19782 fail:
19783  return NULL;
19784 }
19785 
19786 
19787 SWIGINTERN PyObject *_wrap_ProductQuantizer_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19788  PyObject *resultobj = 0;
19790  size_t arg2 ;
19791  void *argp1 = 0 ;
19792  int res1 = 0 ;
19793  size_t val2 ;
19794  int ecode2 = 0 ;
19795  PyObject * obj0 = 0 ;
19796  PyObject * obj1 = 0 ;
19797 
19798  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_d_set",&obj0,&obj1)) SWIG_fail;
19799  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19800  if (!SWIG_IsOK(res1)) {
19801  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19802  }
19803  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19804  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19805  if (!SWIG_IsOK(ecode2)) {
19806  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_d_set" "', argument " "2"" of type '" "size_t""'");
19807  }
19808  arg2 = static_cast< size_t >(val2);
19809  if (arg1) (arg1)->d = arg2;
19810  resultobj = SWIG_Py_Void();
19811  return resultobj;
19812 fail:
19813  return NULL;
19814 }
19815 
19816 
19817 SWIGINTERN PyObject *_wrap_ProductQuantizer_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19818  PyObject *resultobj = 0;
19820  void *argp1 = 0 ;
19821  int res1 = 0 ;
19822  PyObject * obj0 = 0 ;
19823  size_t result;
19824 
19825  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_d_get",&obj0)) SWIG_fail;
19826  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19827  if (!SWIG_IsOK(res1)) {
19828  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_d_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19829  }
19830  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19831  result = (size_t) ((arg1)->d);
19832  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19833  return resultobj;
19834 fail:
19835  return NULL;
19836 }
19837 
19838 
19839 SWIGINTERN PyObject *_wrap_ProductQuantizer_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19840  PyObject *resultobj = 0;
19842  size_t arg2 ;
19843  void *argp1 = 0 ;
19844  int res1 = 0 ;
19845  size_t val2 ;
19846  int ecode2 = 0 ;
19847  PyObject * obj0 = 0 ;
19848  PyObject * obj1 = 0 ;
19849 
19850  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_M_set",&obj0,&obj1)) SWIG_fail;
19851  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19852  if (!SWIG_IsOK(res1)) {
19853  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19854  }
19855  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19856  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19857  if (!SWIG_IsOK(ecode2)) {
19858  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_M_set" "', argument " "2"" of type '" "size_t""'");
19859  }
19860  arg2 = static_cast< size_t >(val2);
19861  if (arg1) (arg1)->M = arg2;
19862  resultobj = SWIG_Py_Void();
19863  return resultobj;
19864 fail:
19865  return NULL;
19866 }
19867 
19868 
19869 SWIGINTERN PyObject *_wrap_ProductQuantizer_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19870  PyObject *resultobj = 0;
19872  void *argp1 = 0 ;
19873  int res1 = 0 ;
19874  PyObject * obj0 = 0 ;
19875  size_t result;
19876 
19877  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_M_get",&obj0)) SWIG_fail;
19878  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19879  if (!SWIG_IsOK(res1)) {
19880  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_M_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19881  }
19882  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19883  result = (size_t) ((arg1)->M);
19884  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19885  return resultobj;
19886 fail:
19887  return NULL;
19888 }
19889 
19890 
19891 SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19892  PyObject *resultobj = 0;
19894  size_t arg2 ;
19895  void *argp1 = 0 ;
19896  int res1 = 0 ;
19897  size_t val2 ;
19898  int ecode2 = 0 ;
19899  PyObject * obj0 = 0 ;
19900  PyObject * obj1 = 0 ;
19901 
19902  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_nbits_set",&obj0,&obj1)) SWIG_fail;
19903  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19904  if (!SWIG_IsOK(res1)) {
19905  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19906  }
19907  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19908  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19909  if (!SWIG_IsOK(ecode2)) {
19910  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_nbits_set" "', argument " "2"" of type '" "size_t""'");
19911  }
19912  arg2 = static_cast< size_t >(val2);
19913  if (arg1) (arg1)->nbits = arg2;
19914  resultobj = SWIG_Py_Void();
19915  return resultobj;
19916 fail:
19917  return NULL;
19918 }
19919 
19920 
19921 SWIGINTERN PyObject *_wrap_ProductQuantizer_nbits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19922  PyObject *resultobj = 0;
19924  void *argp1 = 0 ;
19925  int res1 = 0 ;
19926  PyObject * obj0 = 0 ;
19927  size_t result;
19928 
19929  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_nbits_get",&obj0)) SWIG_fail;
19930  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19931  if (!SWIG_IsOK(res1)) {
19932  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_nbits_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19933  }
19934  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19935  result = (size_t) ((arg1)->nbits);
19936  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19937  return resultobj;
19938 fail:
19939  return NULL;
19940 }
19941 
19942 
19943 SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19944  PyObject *resultobj = 0;
19946  size_t arg2 ;
19947  void *argp1 = 0 ;
19948  int res1 = 0 ;
19949  size_t val2 ;
19950  int ecode2 = 0 ;
19951  PyObject * obj0 = 0 ;
19952  PyObject * obj1 = 0 ;
19953 
19954  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_dsub_set",&obj0,&obj1)) SWIG_fail;
19955  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19956  if (!SWIG_IsOK(res1)) {
19957  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19958  }
19959  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19960  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
19961  if (!SWIG_IsOK(ecode2)) {
19962  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_dsub_set" "', argument " "2"" of type '" "size_t""'");
19963  }
19964  arg2 = static_cast< size_t >(val2);
19965  if (arg1) (arg1)->dsub = arg2;
19966  resultobj = SWIG_Py_Void();
19967  return resultobj;
19968 fail:
19969  return NULL;
19970 }
19971 
19972 
19973 SWIGINTERN PyObject *_wrap_ProductQuantizer_dsub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19974  PyObject *resultobj = 0;
19976  void *argp1 = 0 ;
19977  int res1 = 0 ;
19978  PyObject * obj0 = 0 ;
19979  size_t result;
19980 
19981  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_dsub_get",&obj0)) SWIG_fail;
19982  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
19983  if (!SWIG_IsOK(res1)) {
19984  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_dsub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
19985  }
19986  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
19987  result = (size_t) ((arg1)->dsub);
19988  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
19989  return resultobj;
19990 fail:
19991  return NULL;
19992 }
19993 
19994 
19995 SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19996  PyObject *resultobj = 0;
19998  size_t arg2 ;
19999  void *argp1 = 0 ;
20000  int res1 = 0 ;
20001  size_t val2 ;
20002  int ecode2 = 0 ;
20003  PyObject * obj0 = 0 ;
20004  PyObject * obj1 = 0 ;
20005 
20006  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_byte_per_idx_set",&obj0,&obj1)) SWIG_fail;
20007  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20008  if (!SWIG_IsOK(res1)) {
20009  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20010  }
20011  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20012  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
20013  if (!SWIG_IsOK(ecode2)) {
20014  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_byte_per_idx_set" "', argument " "2"" of type '" "size_t""'");
20015  }
20016  arg2 = static_cast< size_t >(val2);
20017  if (arg1) (arg1)->byte_per_idx = arg2;
20018  resultobj = SWIG_Py_Void();
20019  return resultobj;
20020 fail:
20021  return NULL;
20022 }
20023 
20024 
20025 SWIGINTERN PyObject *_wrap_ProductQuantizer_byte_per_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20026  PyObject *resultobj = 0;
20028  void *argp1 = 0 ;
20029  int res1 = 0 ;
20030  PyObject * obj0 = 0 ;
20031  size_t result;
20032 
20033  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_byte_per_idx_get",&obj0)) SWIG_fail;
20034  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20035  if (!SWIG_IsOK(res1)) {
20036  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_byte_per_idx_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20037  }
20038  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20039  result = (size_t) ((arg1)->byte_per_idx);
20040  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
20041  return resultobj;
20042 fail:
20043  return NULL;
20044 }
20045 
20046 
20047 SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20048  PyObject *resultobj = 0;
20050  size_t arg2 ;
20051  void *argp1 = 0 ;
20052  int res1 = 0 ;
20053  size_t val2 ;
20054  int ecode2 = 0 ;
20055  PyObject * obj0 = 0 ;
20056  PyObject * obj1 = 0 ;
20057 
20058  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_code_size_set",&obj0,&obj1)) SWIG_fail;
20059  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20060  if (!SWIG_IsOK(res1)) {
20061  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20062  }
20063  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20064  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
20065  if (!SWIG_IsOK(ecode2)) {
20066  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_code_size_set" "', argument " "2"" of type '" "size_t""'");
20067  }
20068  arg2 = static_cast< size_t >(val2);
20069  if (arg1) (arg1)->code_size = arg2;
20070  resultobj = SWIG_Py_Void();
20071  return resultobj;
20072 fail:
20073  return NULL;
20074 }
20075 
20076 
20077 SWIGINTERN PyObject *_wrap_ProductQuantizer_code_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20078  PyObject *resultobj = 0;
20080  void *argp1 = 0 ;
20081  int res1 = 0 ;
20082  PyObject * obj0 = 0 ;
20083  size_t result;
20084 
20085  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_code_size_get",&obj0)) SWIG_fail;
20086  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20087  if (!SWIG_IsOK(res1)) {
20088  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_code_size_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20089  }
20090  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20091  result = (size_t) ((arg1)->code_size);
20092  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
20093  return resultobj;
20094 fail:
20095  return NULL;
20096 }
20097 
20098 
20099 SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20100  PyObject *resultobj = 0;
20102  size_t arg2 ;
20103  void *argp1 = 0 ;
20104  int res1 = 0 ;
20105  size_t val2 ;
20106  int ecode2 = 0 ;
20107  PyObject * obj0 = 0 ;
20108  PyObject * obj1 = 0 ;
20109 
20110  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_ksub_set",&obj0,&obj1)) SWIG_fail;
20111  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20112  if (!SWIG_IsOK(res1)) {
20113  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20114  }
20115  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20116  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
20117  if (!SWIG_IsOK(ecode2)) {
20118  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_ksub_set" "', argument " "2"" of type '" "size_t""'");
20119  }
20120  arg2 = static_cast< size_t >(val2);
20121  if (arg1) (arg1)->ksub = arg2;
20122  resultobj = SWIG_Py_Void();
20123  return resultobj;
20124 fail:
20125  return NULL;
20126 }
20127 
20128 
20129 SWIGINTERN PyObject *_wrap_ProductQuantizer_ksub_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20130  PyObject *resultobj = 0;
20132  void *argp1 = 0 ;
20133  int res1 = 0 ;
20134  PyObject * obj0 = 0 ;
20135  size_t result;
20136 
20137  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_ksub_get",&obj0)) SWIG_fail;
20138  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20139  if (!SWIG_IsOK(res1)) {
20140  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_ksub_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20141  }
20142  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20143  result = (size_t) ((arg1)->ksub);
20144  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
20145  return resultobj;
20146 fail:
20147  return NULL;
20148 }
20149 
20150 
20151 SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20152  PyObject *resultobj = 0;
20154  bool arg2 ;
20155  void *argp1 = 0 ;
20156  int res1 = 0 ;
20157  bool val2 ;
20158  int ecode2 = 0 ;
20159  PyObject * obj0 = 0 ;
20160  PyObject * obj1 = 0 ;
20161 
20162  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_verbose_set",&obj0,&obj1)) SWIG_fail;
20163  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20164  if (!SWIG_IsOK(res1)) {
20165  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20166  }
20167  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20168  ecode2 = SWIG_AsVal_bool(obj1, &val2);
20169  if (!SWIG_IsOK(ecode2)) {
20170  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_verbose_set" "', argument " "2"" of type '" "bool""'");
20171  }
20172  arg2 = static_cast< bool >(val2);
20173  if (arg1) (arg1)->verbose = arg2;
20174  resultobj = SWIG_Py_Void();
20175  return resultobj;
20176 fail:
20177  return NULL;
20178 }
20179 
20180 
20181 SWIGINTERN PyObject *_wrap_ProductQuantizer_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20182  PyObject *resultobj = 0;
20184  void *argp1 = 0 ;
20185  int res1 = 0 ;
20186  PyObject * obj0 = 0 ;
20187  bool result;
20188 
20189  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_verbose_get",&obj0)) SWIG_fail;
20190  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20191  if (!SWIG_IsOK(res1)) {
20192  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_verbose_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20193  }
20194  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20195  result = (bool) ((arg1)->verbose);
20196  resultobj = SWIG_From_bool(static_cast< bool >(result));
20197  return resultobj;
20198 fail:
20199  return NULL;
20200 }
20201 
20202 
20203 SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20204  PyObject *resultobj = 0;
20207  void *argp1 = 0 ;
20208  int res1 = 0 ;
20209  int val2 ;
20210  int ecode2 = 0 ;
20211  PyObject * obj0 = 0 ;
20212  PyObject * obj1 = 0 ;
20213 
20214  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_train_type_set",&obj0,&obj1)) SWIG_fail;
20215  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20216  if (!SWIG_IsOK(res1)) {
20217  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20218  }
20219  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20220  ecode2 = SWIG_AsVal_int(obj1, &val2);
20221  if (!SWIG_IsOK(ecode2)) {
20222  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train_type_set" "', argument " "2"" of type '" "faiss::ProductQuantizer::train_type_t""'");
20223  }
20224  arg2 = static_cast< faiss::ProductQuantizer::train_type_t >(val2);
20225  if (arg1) (arg1)->train_type = arg2;
20226  resultobj = SWIG_Py_Void();
20227  return resultobj;
20228 fail:
20229  return NULL;
20230 }
20231 
20232 
20233 SWIGINTERN PyObject *_wrap_ProductQuantizer_train_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20234  PyObject *resultobj = 0;
20236  void *argp1 = 0 ;
20237  int res1 = 0 ;
20238  PyObject * obj0 = 0 ;
20240 
20241  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_train_type_get",&obj0)) SWIG_fail;
20242  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20243  if (!SWIG_IsOK(res1)) {
20244  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train_type_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20245  }
20246  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20247  result = (faiss::ProductQuantizer::train_type_t) ((arg1)->train_type);
20248  resultobj = SWIG_From_int(static_cast< int >(result));
20249  return resultobj;
20250 fail:
20251  return NULL;
20252 }
20253 
20254 
20255 SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20256  PyObject *resultobj = 0;
20259  void *argp1 = 0 ;
20260  int res1 = 0 ;
20261  void *argp2 = 0 ;
20262  int res2 = 0 ;
20263  PyObject * obj0 = 0 ;
20264  PyObject * obj1 = 0 ;
20265 
20266  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_cp_set",&obj0,&obj1)) SWIG_fail;
20267  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20268  if (!SWIG_IsOK(res1)) {
20269  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20270  }
20271  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20272  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
20273  if (!SWIG_IsOK(res2)) {
20274  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_cp_set" "', argument " "2"" of type '" "faiss::ClusteringParameters *""'");
20275  }
20276  arg2 = reinterpret_cast< faiss::ClusteringParameters * >(argp2);
20277  if (arg1) (arg1)->cp = *arg2;
20278  resultobj = SWIG_Py_Void();
20279  return resultobj;
20280 fail:
20281  return NULL;
20282 }
20283 
20284 
20285 SWIGINTERN PyObject *_wrap_ProductQuantizer_cp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20286  PyObject *resultobj = 0;
20288  void *argp1 = 0 ;
20289  int res1 = 0 ;
20290  PyObject * obj0 = 0 ;
20291  faiss::ClusteringParameters *result = 0 ;
20292 
20293  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_cp_get",&obj0)) SWIG_fail;
20294  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20295  if (!SWIG_IsOK(res1)) {
20296  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_cp_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20297  }
20298  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20299  result = (faiss::ClusteringParameters *)& ((arg1)->cp);
20300  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ClusteringParameters, 0 | 0 );
20301  return resultobj;
20302 fail:
20303  return NULL;
20304 }
20305 
20306 
20307 SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20308  PyObject *resultobj = 0;
20310  faiss::Index *arg2 = (faiss::Index *) 0 ;
20311  void *argp1 = 0 ;
20312  int res1 = 0 ;
20313  void *argp2 = 0 ;
20314  int res2 = 0 ;
20315  PyObject * obj0 = 0 ;
20316  PyObject * obj1 = 0 ;
20317 
20318  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_assign_index_set",&obj0,&obj1)) SWIG_fail;
20319  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20320  if (!SWIG_IsOK(res1)) {
20321  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20322  }
20323  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20324  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 );
20325  if (!SWIG_IsOK(res2)) {
20326  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_assign_index_set" "', argument " "2"" of type '" "faiss::Index *""'");
20327  }
20328  arg2 = reinterpret_cast< faiss::Index * >(argp2);
20329  if (arg1) (arg1)->assign_index = arg2;
20330  resultobj = SWIG_Py_Void();
20331  return resultobj;
20332 fail:
20333  return NULL;
20334 }
20335 
20336 
20337 SWIGINTERN PyObject *_wrap_ProductQuantizer_assign_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20338  PyObject *resultobj = 0;
20340  void *argp1 = 0 ;
20341  int res1 = 0 ;
20342  PyObject * obj0 = 0 ;
20343  faiss::Index *result = 0 ;
20344 
20345  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_assign_index_get",&obj0)) SWIG_fail;
20346  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20347  if (!SWIG_IsOK(res1)) {
20348  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_assign_index_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20349  }
20350  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20351  result = (faiss::Index *) ((arg1)->assign_index);
20352  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 );
20353  return resultobj;
20354 fail:
20355  return NULL;
20356 }
20357 
20358 
20359 SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20360  PyObject *resultobj = 0;
20362  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
20363  void *argp1 = 0 ;
20364  int res1 = 0 ;
20365  void *argp2 = 0 ;
20366  int res2 = 0 ;
20367  PyObject * obj0 = 0 ;
20368  PyObject * obj1 = 0 ;
20369 
20370  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_centroids_set",&obj0,&obj1)) SWIG_fail;
20371  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20372  if (!SWIG_IsOK(res1)) {
20373  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20374  }
20375  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20376  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
20377  if (!SWIG_IsOK(res2)) {
20378  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_centroids_set" "', argument " "2"" of type '" "std::vector< float > *""'");
20379  }
20380  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
20381  if (arg1) (arg1)->centroids = *arg2;
20382  resultobj = SWIG_Py_Void();
20383  return resultobj;
20384 fail:
20385  return NULL;
20386 }
20387 
20388 
20389 SWIGINTERN PyObject *_wrap_ProductQuantizer_centroids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20390  PyObject *resultobj = 0;
20392  void *argp1 = 0 ;
20393  int res1 = 0 ;
20394  PyObject * obj0 = 0 ;
20395  std::vector< float > *result = 0 ;
20396 
20397  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_centroids_get",&obj0)) SWIG_fail;
20398  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20399  if (!SWIG_IsOK(res1)) {
20400  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_centroids_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20401  }
20402  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20403  result = (std::vector< float > *)& ((arg1)->centroids);
20404  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
20405  return resultobj;
20406 fail:
20407  return NULL;
20408 }
20409 
20410 
20411 SWIGINTERN PyObject *_wrap_ProductQuantizer_get_centroids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20412  PyObject *resultobj = 0;
20414  size_t arg2 ;
20415  size_t arg3 ;
20416  void *argp1 = 0 ;
20417  int res1 = 0 ;
20418  size_t val2 ;
20419  int ecode2 = 0 ;
20420  size_t val3 ;
20421  int ecode3 = 0 ;
20422  PyObject * obj0 = 0 ;
20423  PyObject * obj1 = 0 ;
20424  PyObject * obj2 = 0 ;
20425  float *result = 0 ;
20426 
20427  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_get_centroids",&obj0,&obj1,&obj2)) SWIG_fail;
20428  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20429  if (!SWIG_IsOK(res1)) {
20430  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_get_centroids" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20431  }
20432  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20433  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
20434  if (!SWIG_IsOK(ecode2)) {
20435  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_get_centroids" "', argument " "2"" of type '" "size_t""'");
20436  }
20437  arg2 = static_cast< size_t >(val2);
20438  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
20439  if (!SWIG_IsOK(ecode3)) {
20440  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_get_centroids" "', argument " "3"" of type '" "size_t""'");
20441  }
20442  arg3 = static_cast< size_t >(val3);
20443  {
20444  Py_BEGIN_ALLOW_THREADS
20445  try {
20446  result = (float *)(arg1)->get_centroids(arg2,arg3);
20447  } catch(faiss::FaissException & e) {
20448  PyEval_RestoreThread(_save);
20449 
20450  if (PyErr_Occurred()) {
20451  // some previous code already set the error type.
20452  } else {
20453  PyErr_SetString(PyExc_RuntimeError, e.what());
20454  }
20455  SWIG_fail;
20456  }
20457  Py_END_ALLOW_THREADS
20458  }
20459  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
20460  return resultobj;
20461 fail:
20462  return NULL;
20463 }
20464 
20465 
20466 SWIGINTERN PyObject *_wrap_ProductQuantizer_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20467  PyObject *resultobj = 0;
20469  int arg2 ;
20470  float *arg3 = (float *) 0 ;
20471  void *argp1 = 0 ;
20472  int res1 = 0 ;
20473  int val2 ;
20474  int ecode2 = 0 ;
20475  void *argp3 = 0 ;
20476  int res3 = 0 ;
20477  PyObject * obj0 = 0 ;
20478  PyObject * obj1 = 0 ;
20479  PyObject * obj2 = 0 ;
20480 
20481  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_train",&obj0,&obj1,&obj2)) SWIG_fail;
20482  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20483  if (!SWIG_IsOK(res1)) {
20484  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_train" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20485  }
20486  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20487  ecode2 = SWIG_AsVal_int(obj1, &val2);
20488  if (!SWIG_IsOK(ecode2)) {
20489  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_train" "', argument " "2"" of type '" "int""'");
20490  }
20491  arg2 = static_cast< int >(val2);
20492  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
20493  if (!SWIG_IsOK(res3)) {
20494  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_train" "', argument " "3"" of type '" "float const *""'");
20495  }
20496  arg3 = reinterpret_cast< float * >(argp3);
20497  {
20498  Py_BEGIN_ALLOW_THREADS
20499  try {
20500  (arg1)->train(arg2,(float const *)arg3);
20501  } catch(faiss::FaissException & e) {
20502  PyEval_RestoreThread(_save);
20503 
20504  if (PyErr_Occurred()) {
20505  // some previous code already set the error type.
20506  } else {
20507  PyErr_SetString(PyExc_RuntimeError, e.what());
20508  }
20509  SWIG_fail;
20510  }
20511  Py_END_ALLOW_THREADS
20512  }
20513  resultobj = SWIG_Py_Void();
20514  return resultobj;
20515 fail:
20516  return NULL;
20517 }
20518 
20519 
20520 SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20521  PyObject *resultobj = 0;
20522  size_t arg1 ;
20523  size_t arg2 ;
20524  size_t arg3 ;
20525  size_t val1 ;
20526  int ecode1 = 0 ;
20527  size_t val2 ;
20528  int ecode2 = 0 ;
20529  size_t val3 ;
20530  int ecode3 = 0 ;
20531  PyObject * obj0 = 0 ;
20532  PyObject * obj1 = 0 ;
20533  PyObject * obj2 = 0 ;
20534  faiss::ProductQuantizer *result = 0 ;
20535 
20536  if (!PyArg_ParseTuple(args,(char *)"OOO:new_ProductQuantizer",&obj0,&obj1,&obj2)) SWIG_fail;
20537  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
20538  if (!SWIG_IsOK(ecode1)) {
20539  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ProductQuantizer" "', argument " "1"" of type '" "size_t""'");
20540  }
20541  arg1 = static_cast< size_t >(val1);
20542  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
20543  if (!SWIG_IsOK(ecode2)) {
20544  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_ProductQuantizer" "', argument " "2"" of type '" "size_t""'");
20545  }
20546  arg2 = static_cast< size_t >(val2);
20547  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
20548  if (!SWIG_IsOK(ecode3)) {
20549  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ProductQuantizer" "', argument " "3"" of type '" "size_t""'");
20550  }
20551  arg3 = static_cast< size_t >(val3);
20552  {
20553  Py_BEGIN_ALLOW_THREADS
20554  try {
20555  result = (faiss::ProductQuantizer *)new faiss::ProductQuantizer(arg1,arg2,arg3);
20556  } catch(faiss::FaissException & e) {
20557  PyEval_RestoreThread(_save);
20558 
20559  if (PyErr_Occurred()) {
20560  // some previous code already set the error type.
20561  } else {
20562  PyErr_SetString(PyExc_RuntimeError, e.what());
20563  }
20564  SWIG_fail;
20565  }
20566  Py_END_ALLOW_THREADS
20567  }
20568  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 );
20569  return resultobj;
20570 fail:
20571  return NULL;
20572 }
20573 
20574 
20575 SWIGINTERN PyObject *_wrap_new_ProductQuantizer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20576  PyObject *resultobj = 0;
20577  faiss::ProductQuantizer *result = 0 ;
20578 
20579  if (!PyArg_ParseTuple(args,(char *)":new_ProductQuantizer")) SWIG_fail;
20580  {
20581  Py_BEGIN_ALLOW_THREADS
20582  try {
20584  } catch(faiss::FaissException & e) {
20585  PyEval_RestoreThread(_save);
20586 
20587  if (PyErr_Occurred()) {
20588  // some previous code already set the error type.
20589  } else {
20590  PyErr_SetString(PyExc_RuntimeError, e.what());
20591  }
20592  SWIG_fail;
20593  }
20594  Py_END_ALLOW_THREADS
20595  }
20596  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_NEW | 0 );
20597  return resultobj;
20598 fail:
20599  return NULL;
20600 }
20601 
20602 
20603 SWIGINTERN PyObject *_wrap_new_ProductQuantizer(PyObject *self, PyObject *args) {
20604  Py_ssize_t argc;
20605  PyObject *argv[4] = {
20606  0
20607  };
20608  Py_ssize_t ii;
20609 
20610  if (!PyTuple_Check(args)) SWIG_fail;
20611  argc = args ? PyObject_Length(args) : 0;
20612  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
20613  argv[ii] = PyTuple_GET_ITEM(args,ii);
20614  }
20615  if (argc == 0) {
20616  return _wrap_new_ProductQuantizer__SWIG_1(self, args);
20617  }
20618  if (argc == 3) {
20619  int _v;
20620  {
20621  int res = SWIG_AsVal_size_t(argv[0], NULL);
20622  _v = SWIG_CheckState(res);
20623  }
20624  if (_v) {
20625  {
20626  int res = SWIG_AsVal_size_t(argv[1], NULL);
20627  _v = SWIG_CheckState(res);
20628  }
20629  if (_v) {
20630  {
20631  int res = SWIG_AsVal_size_t(argv[2], NULL);
20632  _v = SWIG_CheckState(res);
20633  }
20634  if (_v) {
20635  return _wrap_new_ProductQuantizer__SWIG_0(self, args);
20636  }
20637  }
20638  }
20639  }
20640 
20641 fail:
20642  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ProductQuantizer'.\n"
20643  " Possible C/C++ prototypes are:\n"
20644  " faiss::ProductQuantizer::ProductQuantizer(size_t,size_t,size_t)\n"
20645  " faiss::ProductQuantizer::ProductQuantizer()\n");
20646  return 0;
20647 }
20648 
20649 
20650 SWIGINTERN PyObject *_wrap_ProductQuantizer_set_derived_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20651  PyObject *resultobj = 0;
20653  void *argp1 = 0 ;
20654  int res1 = 0 ;
20655  PyObject * obj0 = 0 ;
20656 
20657  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_set_derived_values",&obj0)) SWIG_fail;
20658  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20659  if (!SWIG_IsOK(res1)) {
20660  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_derived_values" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20661  }
20662  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20663  {
20664  Py_BEGIN_ALLOW_THREADS
20665  try {
20666  (arg1)->set_derived_values();
20667  } catch(faiss::FaissException & e) {
20668  PyEval_RestoreThread(_save);
20669 
20670  if (PyErr_Occurred()) {
20671  // some previous code already set the error type.
20672  } else {
20673  PyErr_SetString(PyExc_RuntimeError, e.what());
20674  }
20675  SWIG_fail;
20676  }
20677  Py_END_ALLOW_THREADS
20678  }
20679  resultobj = SWIG_Py_Void();
20680  return resultobj;
20681 fail:
20682  return NULL;
20683 }
20684 
20685 
20686 SWIGINTERN PyObject *_wrap_ProductQuantizer_set_params(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20687  PyObject *resultobj = 0;
20689  float *arg2 = (float *) 0 ;
20690  int arg3 ;
20691  void *argp1 = 0 ;
20692  int res1 = 0 ;
20693  void *argp2 = 0 ;
20694  int res2 = 0 ;
20695  int val3 ;
20696  int ecode3 = 0 ;
20697  PyObject * obj0 = 0 ;
20698  PyObject * obj1 = 0 ;
20699  PyObject * obj2 = 0 ;
20700 
20701  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_set_params",&obj0,&obj1,&obj2)) SWIG_fail;
20702  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20703  if (!SWIG_IsOK(res1)) {
20704  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_set_params" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20705  }
20706  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20707  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
20708  if (!SWIG_IsOK(res2)) {
20709  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_set_params" "', argument " "2"" of type '" "float const *""'");
20710  }
20711  arg2 = reinterpret_cast< float * >(argp2);
20712  ecode3 = SWIG_AsVal_int(obj2, &val3);
20713  if (!SWIG_IsOK(ecode3)) {
20714  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_set_params" "', argument " "3"" of type '" "int""'");
20715  }
20716  arg3 = static_cast< int >(val3);
20717  {
20718  Py_BEGIN_ALLOW_THREADS
20719  try {
20720  (arg1)->set_params((float const *)arg2,arg3);
20721  } catch(faiss::FaissException & e) {
20722  PyEval_RestoreThread(_save);
20723 
20724  if (PyErr_Occurred()) {
20725  // some previous code already set the error type.
20726  } else {
20727  PyErr_SetString(PyExc_RuntimeError, e.what());
20728  }
20729  SWIG_fail;
20730  }
20731  Py_END_ALLOW_THREADS
20732  }
20733  resultobj = SWIG_Py_Void();
20734  return resultobj;
20735 fail:
20736  return NULL;
20737 }
20738 
20739 
20740 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20741  PyObject *resultobj = 0;
20743  float *arg2 = (float *) 0 ;
20744  uint8_t *arg3 = (uint8_t *) 0 ;
20745  void *argp1 = 0 ;
20746  int res1 = 0 ;
20747  void *argp2 = 0 ;
20748  int res2 = 0 ;
20749  void *argp3 = 0 ;
20750  int res3 = 0 ;
20751  PyObject * obj0 = 0 ;
20752  PyObject * obj1 = 0 ;
20753  PyObject * obj2 = 0 ;
20754 
20755  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code",&obj0,&obj1,&obj2)) SWIG_fail;
20756  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20757  if (!SWIG_IsOK(res1)) {
20758  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
20759  }
20760  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20761  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
20762  if (!SWIG_IsOK(res2)) {
20763  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code" "', argument " "2"" of type '" "float const *""'");
20764  }
20765  arg2 = reinterpret_cast< float * >(argp2);
20766  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
20767  if (!SWIG_IsOK(res3)) {
20768  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code" "', argument " "3"" of type '" "uint8_t *""'");
20769  }
20770  arg3 = reinterpret_cast< uint8_t * >(argp3);
20771  {
20772  Py_BEGIN_ALLOW_THREADS
20773  try {
20774  ((faiss::ProductQuantizer const *)arg1)->compute_code((float const *)arg2,arg3);
20775  } catch(faiss::FaissException & e) {
20776  PyEval_RestoreThread(_save);
20777 
20778  if (PyErr_Occurred()) {
20779  // some previous code already set the error type.
20780  } else {
20781  PyErr_SetString(PyExc_RuntimeError, e.what());
20782  }
20783  SWIG_fail;
20784  }
20785  Py_END_ALLOW_THREADS
20786  }
20787  resultobj = SWIG_Py_Void();
20788  return resultobj;
20789 fail:
20790  return NULL;
20791 }
20792 
20793 
20794 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20795  PyObject *resultobj = 0;
20797  float *arg2 = (float *) 0 ;
20798  uint8_t *arg3 = (uint8_t *) 0 ;
20799  size_t arg4 ;
20800  void *argp1 = 0 ;
20801  int res1 = 0 ;
20802  void *argp2 = 0 ;
20803  int res2 = 0 ;
20804  void *argp3 = 0 ;
20805  int res3 = 0 ;
20806  size_t val4 ;
20807  int ecode4 = 0 ;
20808  PyObject * obj0 = 0 ;
20809  PyObject * obj1 = 0 ;
20810  PyObject * obj2 = 0 ;
20811  PyObject * obj3 = 0 ;
20812 
20813  if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
20814  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20815  if (!SWIG_IsOK(res1)) {
20816  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
20817  }
20818  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20819  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
20820  if (!SWIG_IsOK(res2)) {
20821  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes" "', argument " "2"" of type '" "float const *""'");
20822  }
20823  arg2 = reinterpret_cast< float * >(argp2);
20824  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
20825  if (!SWIG_IsOK(res3)) {
20826  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes" "', argument " "3"" of type '" "uint8_t *""'");
20827  }
20828  arg3 = reinterpret_cast< uint8_t * >(argp3);
20829  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
20830  if (!SWIG_IsOK(ecode4)) {
20831  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes" "', argument " "4"" of type '" "size_t""'");
20832  }
20833  arg4 = static_cast< size_t >(val4);
20834  {
20835  Py_BEGIN_ALLOW_THREADS
20836  try {
20837  ((faiss::ProductQuantizer const *)arg1)->compute_codes((float const *)arg2,arg3,arg4);
20838  } catch(faiss::FaissException & e) {
20839  PyEval_RestoreThread(_save);
20840 
20841  if (PyErr_Occurred()) {
20842  // some previous code already set the error type.
20843  } else {
20844  PyErr_SetString(PyExc_RuntimeError, e.what());
20845  }
20846  SWIG_fail;
20847  }
20848  Py_END_ALLOW_THREADS
20849  }
20850  resultobj = SWIG_Py_Void();
20851  return resultobj;
20852 fail:
20853  return NULL;
20854 }
20855 
20856 
20857 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_codes_with_assign_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20858  PyObject *resultobj = 0;
20860  float *arg2 = (float *) 0 ;
20861  uint8_t *arg3 = (uint8_t *) 0 ;
20862  size_t arg4 ;
20863  void *argp1 = 0 ;
20864  int res1 = 0 ;
20865  void *argp2 = 0 ;
20866  int res2 = 0 ;
20867  void *argp3 = 0 ;
20868  int res3 = 0 ;
20869  size_t val4 ;
20870  int ecode4 = 0 ;
20871  PyObject * obj0 = 0 ;
20872  PyObject * obj1 = 0 ;
20873  PyObject * obj2 = 0 ;
20874  PyObject * obj3 = 0 ;
20875 
20876  if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_codes_with_assign_index",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
20877  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20878  if (!SWIG_IsOK(res1)) {
20879  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
20880  }
20881  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20882  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
20883  if (!SWIG_IsOK(res2)) {
20884  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "2"" of type '" "float const *""'");
20885  }
20886  arg2 = reinterpret_cast< float * >(argp2);
20887  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
20888  if (!SWIG_IsOK(res3)) {
20889  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "3"" of type '" "uint8_t *""'");
20890  }
20891  arg3 = reinterpret_cast< uint8_t * >(argp3);
20892  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
20893  if (!SWIG_IsOK(ecode4)) {
20894  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_compute_codes_with_assign_index" "', argument " "4"" of type '" "size_t""'");
20895  }
20896  arg4 = static_cast< size_t >(val4);
20897  {
20898  Py_BEGIN_ALLOW_THREADS
20899  try {
20900  (arg1)->compute_codes_with_assign_index((float const *)arg2,arg3,arg4);
20901  } catch(faiss::FaissException & e) {
20902  PyEval_RestoreThread(_save);
20903 
20904  if (PyErr_Occurred()) {
20905  // some previous code already set the error type.
20906  } else {
20907  PyErr_SetString(PyExc_RuntimeError, e.what());
20908  }
20909  SWIG_fail;
20910  }
20911  Py_END_ALLOW_THREADS
20912  }
20913  resultobj = SWIG_Py_Void();
20914  return resultobj;
20915 fail:
20916  return NULL;
20917 }
20918 
20919 
20920 SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20921  PyObject *resultobj = 0;
20923  uint8_t *arg2 = (uint8_t *) 0 ;
20924  float *arg3 = (float *) 0 ;
20925  void *argp1 = 0 ;
20926  int res1 = 0 ;
20927  void *argp2 = 0 ;
20928  int res2 = 0 ;
20929  void *argp3 = 0 ;
20930  int res3 = 0 ;
20931  PyObject * obj0 = 0 ;
20932  PyObject * obj1 = 0 ;
20933  PyObject * obj2 = 0 ;
20934 
20935  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_decode",&obj0,&obj1,&obj2)) SWIG_fail;
20936  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20937  if (!SWIG_IsOK(res1)) {
20938  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
20939  }
20940  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20941  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
20942  if (!SWIG_IsOK(res2)) {
20943  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'");
20944  }
20945  arg2 = reinterpret_cast< uint8_t * >(argp2);
20946  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
20947  if (!SWIG_IsOK(res3)) {
20948  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'");
20949  }
20950  arg3 = reinterpret_cast< float * >(argp3);
20951  {
20952  Py_BEGIN_ALLOW_THREADS
20953  try {
20954  ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3);
20955  } catch(faiss::FaissException & e) {
20956  PyEval_RestoreThread(_save);
20957 
20958  if (PyErr_Occurred()) {
20959  // some previous code already set the error type.
20960  } else {
20961  PyErr_SetString(PyExc_RuntimeError, e.what());
20962  }
20963  SWIG_fail;
20964  }
20965  Py_END_ALLOW_THREADS
20966  }
20967  resultobj = SWIG_Py_Void();
20968  return resultobj;
20969 fail:
20970  return NULL;
20971 }
20972 
20973 
20974 SWIGINTERN PyObject *_wrap_ProductQuantizer_decode__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20975  PyObject *resultobj = 0;
20977  uint8_t *arg2 = (uint8_t *) 0 ;
20978  float *arg3 = (float *) 0 ;
20979  size_t arg4 ;
20980  void *argp1 = 0 ;
20981  int res1 = 0 ;
20982  void *argp2 = 0 ;
20983  int res2 = 0 ;
20984  void *argp3 = 0 ;
20985  int res3 = 0 ;
20986  size_t val4 ;
20987  int ecode4 = 0 ;
20988  PyObject * obj0 = 0 ;
20989  PyObject * obj1 = 0 ;
20990  PyObject * obj2 = 0 ;
20991  PyObject * obj3 = 0 ;
20992 
20993  if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_decode",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
20994  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
20995  if (!SWIG_IsOK(res1)) {
20996  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_decode" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
20997  }
20998  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
20999  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
21000  if (!SWIG_IsOK(res2)) {
21001  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_decode" "', argument " "2"" of type '" "uint8_t const *""'");
21002  }
21003  arg2 = reinterpret_cast< uint8_t * >(argp2);
21004  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
21005  if (!SWIG_IsOK(res3)) {
21006  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_decode" "', argument " "3"" of type '" "float *""'");
21007  }
21008  arg3 = reinterpret_cast< float * >(argp3);
21009  ecode4 = SWIG_AsVal_size_t(obj3, &val4);
21010  if (!SWIG_IsOK(ecode4)) {
21011  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ProductQuantizer_decode" "', argument " "4"" of type '" "size_t""'");
21012  }
21013  arg4 = static_cast< size_t >(val4);
21014  {
21015  Py_BEGIN_ALLOW_THREADS
21016  try {
21017  ((faiss::ProductQuantizer const *)arg1)->decode((uint8_t const *)arg2,arg3,arg4);
21018  } catch(faiss::FaissException & e) {
21019  PyEval_RestoreThread(_save);
21020 
21021  if (PyErr_Occurred()) {
21022  // some previous code already set the error type.
21023  } else {
21024  PyErr_SetString(PyExc_RuntimeError, e.what());
21025  }
21026  SWIG_fail;
21027  }
21028  Py_END_ALLOW_THREADS
21029  }
21030  resultobj = SWIG_Py_Void();
21031  return resultobj;
21032 fail:
21033  return NULL;
21034 }
21035 
21036 
21037 SWIGINTERN PyObject *_wrap_ProductQuantizer_decode(PyObject *self, PyObject *args) {
21038  Py_ssize_t argc;
21039  PyObject *argv[5] = {
21040  0
21041  };
21042  Py_ssize_t ii;
21043 
21044  if (!PyTuple_Check(args)) SWIG_fail;
21045  argc = args ? PyObject_Length(args) : 0;
21046  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
21047  argv[ii] = PyTuple_GET_ITEM(args,ii);
21048  }
21049  if (argc == 3) {
21050  int _v;
21051  void *vptr = 0;
21052  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21053  _v = SWIG_CheckState(res);
21054  if (_v) {
21055  void *vptr = 0;
21056  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
21057  _v = SWIG_CheckState(res);
21058  if (_v) {
21059  void *vptr = 0;
21060  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
21061  _v = SWIG_CheckState(res);
21062  if (_v) {
21063  return _wrap_ProductQuantizer_decode__SWIG_0(self, args);
21064  }
21065  }
21066  }
21067  }
21068  if (argc == 4) {
21069  int _v;
21070  void *vptr = 0;
21071  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21072  _v = SWIG_CheckState(res);
21073  if (_v) {
21074  void *vptr = 0;
21075  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
21076  _v = SWIG_CheckState(res);
21077  if (_v) {
21078  void *vptr = 0;
21079  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_float, 0);
21080  _v = SWIG_CheckState(res);
21081  if (_v) {
21082  {
21083  int res = SWIG_AsVal_size_t(argv[3], NULL);
21084  _v = SWIG_CheckState(res);
21085  }
21086  if (_v) {
21087  return _wrap_ProductQuantizer_decode__SWIG_1(self, args);
21088  }
21089  }
21090  }
21091  }
21092  }
21093 
21094 fail:
21095  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_decode'.\n"
21096  " Possible C/C++ prototypes are:\n"
21097  " faiss::ProductQuantizer::decode(uint8_t const *,float *) const\n"
21098  " faiss::ProductQuantizer::decode(uint8_t const *,float *,size_t) const\n");
21099  return 0;
21100 }
21101 
21102 
21103 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_code_from_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21104  PyObject *resultobj = 0;
21106  float *arg2 = (float *) 0 ;
21107  uint8_t *arg3 = (uint8_t *) 0 ;
21108  void *argp1 = 0 ;
21109  int res1 = 0 ;
21110  void *argp2 = 0 ;
21111  int res2 = 0 ;
21112  void *argp3 = 0 ;
21113  int res3 = 0 ;
21114  PyObject * obj0 = 0 ;
21115  PyObject * obj1 = 0 ;
21116  PyObject * obj2 = 0 ;
21117 
21118  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_code_from_distance_table",&obj0,&obj1,&obj2)) SWIG_fail;
21119  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21120  if (!SWIG_IsOK(res1)) {
21121  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21122  }
21123  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21124  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21125  if (!SWIG_IsOK(res2)) {
21126  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "2"" of type '" "float const *""'");
21127  }
21128  arg2 = reinterpret_cast< float * >(argp2);
21129  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
21130  if (!SWIG_IsOK(res3)) {
21131  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_code_from_distance_table" "', argument " "3"" of type '" "uint8_t *""'");
21132  }
21133  arg3 = reinterpret_cast< uint8_t * >(argp3);
21134  {
21135  Py_BEGIN_ALLOW_THREADS
21136  try {
21137  ((faiss::ProductQuantizer const *)arg1)->compute_code_from_distance_table((float const *)arg2,arg3);
21138  } catch(faiss::FaissException & e) {
21139  PyEval_RestoreThread(_save);
21140 
21141  if (PyErr_Occurred()) {
21142  // some previous code already set the error type.
21143  } else {
21144  PyErr_SetString(PyExc_RuntimeError, e.what());
21145  }
21146  SWIG_fail;
21147  }
21148  Py_END_ALLOW_THREADS
21149  }
21150  resultobj = SWIG_Py_Void();
21151  return resultobj;
21152 fail:
21153  return NULL;
21154 }
21155 
21156 
21157 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21158  PyObject *resultobj = 0;
21160  float *arg2 = (float *) 0 ;
21161  float *arg3 = (float *) 0 ;
21162  void *argp1 = 0 ;
21163  int res1 = 0 ;
21164  void *argp2 = 0 ;
21165  int res2 = 0 ;
21166  void *argp3 = 0 ;
21167  int res3 = 0 ;
21168  PyObject * obj0 = 0 ;
21169  PyObject * obj1 = 0 ;
21170  PyObject * obj2 = 0 ;
21171 
21172  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_distance_table",&obj0,&obj1,&obj2)) SWIG_fail;
21173  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21174  if (!SWIG_IsOK(res1)) {
21175  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21176  }
21177  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21178  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21179  if (!SWIG_IsOK(res2)) {
21180  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "2"" of type '" "float const *""'");
21181  }
21182  arg2 = reinterpret_cast< float * >(argp2);
21183  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
21184  if (!SWIG_IsOK(res3)) {
21185  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_table" "', argument " "3"" of type '" "float *""'");
21186  }
21187  arg3 = reinterpret_cast< float * >(argp3);
21188  {
21189  Py_BEGIN_ALLOW_THREADS
21190  try {
21191  ((faiss::ProductQuantizer const *)arg1)->compute_distance_table((float const *)arg2,arg3);
21192  } catch(faiss::FaissException & e) {
21193  PyEval_RestoreThread(_save);
21194 
21195  if (PyErr_Occurred()) {
21196  // some previous code already set the error type.
21197  } else {
21198  PyErr_SetString(PyExc_RuntimeError, e.what());
21199  }
21200  SWIG_fail;
21201  }
21202  Py_END_ALLOW_THREADS
21203  }
21204  resultobj = SWIG_Py_Void();
21205  return resultobj;
21206 fail:
21207  return NULL;
21208 }
21209 
21210 
21211 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21212  PyObject *resultobj = 0;
21214  float *arg2 = (float *) 0 ;
21215  float *arg3 = (float *) 0 ;
21216  void *argp1 = 0 ;
21217  int res1 = 0 ;
21218  void *argp2 = 0 ;
21219  int res2 = 0 ;
21220  void *argp3 = 0 ;
21221  int res3 = 0 ;
21222  PyObject * obj0 = 0 ;
21223  PyObject * obj1 = 0 ;
21224  PyObject * obj2 = 0 ;
21225 
21226  if (!PyArg_ParseTuple(args,(char *)"OOO:ProductQuantizer_compute_inner_prod_table",&obj0,&obj1,&obj2)) SWIG_fail;
21227  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21228  if (!SWIG_IsOK(res1)) {
21229  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21230  }
21231  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21232  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21233  if (!SWIG_IsOK(res2)) {
21234  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "2"" of type '" "float const *""'");
21235  }
21236  arg2 = reinterpret_cast< float * >(argp2);
21237  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
21238  if (!SWIG_IsOK(res3)) {
21239  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_table" "', argument " "3"" of type '" "float *""'");
21240  }
21241  arg3 = reinterpret_cast< float * >(argp3);
21242  {
21243  Py_BEGIN_ALLOW_THREADS
21244  try {
21245  ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_table((float const *)arg2,arg3);
21246  } catch(faiss::FaissException & e) {
21247  PyEval_RestoreThread(_save);
21248 
21249  if (PyErr_Occurred()) {
21250  // some previous code already set the error type.
21251  } else {
21252  PyErr_SetString(PyExc_RuntimeError, e.what());
21253  }
21254  SWIG_fail;
21255  }
21256  Py_END_ALLOW_THREADS
21257  }
21258  resultobj = SWIG_Py_Void();
21259  return resultobj;
21260 fail:
21261  return NULL;
21262 }
21263 
21264 
21265 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_distance_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21266  PyObject *resultobj = 0;
21268  size_t arg2 ;
21269  float *arg3 = (float *) 0 ;
21270  float *arg4 = (float *) 0 ;
21271  void *argp1 = 0 ;
21272  int res1 = 0 ;
21273  size_t val2 ;
21274  int ecode2 = 0 ;
21275  void *argp3 = 0 ;
21276  int res3 = 0 ;
21277  void *argp4 = 0 ;
21278  int res4 = 0 ;
21279  PyObject * obj0 = 0 ;
21280  PyObject * obj1 = 0 ;
21281  PyObject * obj2 = 0 ;
21282  PyObject * obj3 = 0 ;
21283 
21284  if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_distance_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
21285  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21286  if (!SWIG_IsOK(res1)) {
21287  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21288  }
21289  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21290  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
21291  if (!SWIG_IsOK(ecode2)) {
21292  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "2"" of type '" "size_t""'");
21293  }
21294  arg2 = static_cast< size_t >(val2);
21295  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
21296  if (!SWIG_IsOK(res3)) {
21297  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "3"" of type '" "float const *""'");
21298  }
21299  arg3 = reinterpret_cast< float * >(argp3);
21300  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
21301  if (!SWIG_IsOK(res4)) {
21302  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_distance_tables" "', argument " "4"" of type '" "float *""'");
21303  }
21304  arg4 = reinterpret_cast< float * >(argp4);
21305  {
21306  Py_BEGIN_ALLOW_THREADS
21307  try {
21308  ((faiss::ProductQuantizer const *)arg1)->compute_distance_tables(arg2,(float const *)arg3,arg4);
21309  } catch(faiss::FaissException & e) {
21310  PyEval_RestoreThread(_save);
21311 
21312  if (PyErr_Occurred()) {
21313  // some previous code already set the error type.
21314  } else {
21315  PyErr_SetString(PyExc_RuntimeError, e.what());
21316  }
21317  SWIG_fail;
21318  }
21319  Py_END_ALLOW_THREADS
21320  }
21321  resultobj = SWIG_Py_Void();
21322  return resultobj;
21323 fail:
21324  return NULL;
21325 }
21326 
21327 
21328 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_inner_prod_tables(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21329  PyObject *resultobj = 0;
21331  size_t arg2 ;
21332  float *arg3 = (float *) 0 ;
21333  float *arg4 = (float *) 0 ;
21334  void *argp1 = 0 ;
21335  int res1 = 0 ;
21336  size_t val2 ;
21337  int ecode2 = 0 ;
21338  void *argp3 = 0 ;
21339  int res3 = 0 ;
21340  void *argp4 = 0 ;
21341  int res4 = 0 ;
21342  PyObject * obj0 = 0 ;
21343  PyObject * obj1 = 0 ;
21344  PyObject * obj2 = 0 ;
21345  PyObject * obj3 = 0 ;
21346 
21347  if (!PyArg_ParseTuple(args,(char *)"OOOO:ProductQuantizer_compute_inner_prod_tables",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
21348  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21349  if (!SWIG_IsOK(res1)) {
21350  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21351  }
21352  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21353  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
21354  if (!SWIG_IsOK(ecode2)) {
21355  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "2"" of type '" "size_t""'");
21356  }
21357  arg2 = static_cast< size_t >(val2);
21358  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
21359  if (!SWIG_IsOK(res3)) {
21360  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "3"" of type '" "float const *""'");
21361  }
21362  arg3 = reinterpret_cast< float * >(argp3);
21363  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
21364  if (!SWIG_IsOK(res4)) {
21365  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_compute_inner_prod_tables" "', argument " "4"" of type '" "float *""'");
21366  }
21367  arg4 = reinterpret_cast< float * >(argp4);
21368  {
21369  Py_BEGIN_ALLOW_THREADS
21370  try {
21371  ((faiss::ProductQuantizer const *)arg1)->compute_inner_prod_tables(arg2,(float const *)arg3,arg4);
21372  } catch(faiss::FaissException & e) {
21373  PyEval_RestoreThread(_save);
21374 
21375  if (PyErr_Occurred()) {
21376  // some previous code already set the error type.
21377  } else {
21378  PyErr_SetString(PyExc_RuntimeError, e.what());
21379  }
21380  SWIG_fail;
21381  }
21382  Py_END_ALLOW_THREADS
21383  }
21384  resultobj = SWIG_Py_Void();
21385  return resultobj;
21386 fail:
21387  return NULL;
21388 }
21389 
21390 
21391 SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21392  PyObject *resultobj = 0;
21394  float *arg2 = (float *) 0 ;
21395  size_t arg3 ;
21396  uint8_t *arg4 = (uint8_t *) 0 ;
21397  size_t arg5 ;
21399  bool arg7 ;
21400  void *argp1 = 0 ;
21401  int res1 = 0 ;
21402  void *argp2 = 0 ;
21403  int res2 = 0 ;
21404  size_t val3 ;
21405  int ecode3 = 0 ;
21406  void *argp4 = 0 ;
21407  int res4 = 0 ;
21408  size_t val5 ;
21409  int ecode5 = 0 ;
21410  void *argp6 = 0 ;
21411  int res6 = 0 ;
21412  bool val7 ;
21413  int ecode7 = 0 ;
21414  PyObject * obj0 = 0 ;
21415  PyObject * obj1 = 0 ;
21416  PyObject * obj2 = 0 ;
21417  PyObject * obj3 = 0 ;
21418  PyObject * obj4 = 0 ;
21419  PyObject * obj5 = 0 ;
21420  PyObject * obj6 = 0 ;
21421 
21422  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
21423  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21424  if (!SWIG_IsOK(res1)) {
21425  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21426  }
21427  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21428  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21429  if (!SWIG_IsOK(res2)) {
21430  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'");
21431  }
21432  arg2 = reinterpret_cast< float * >(argp2);
21433  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
21434  if (!SWIG_IsOK(ecode3)) {
21435  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'");
21436  }
21437  arg3 = static_cast< size_t >(val3);
21438  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
21439  if (!SWIG_IsOK(res4)) {
21440  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'");
21441  }
21442  arg4 = reinterpret_cast< uint8_t * >(argp4);
21443  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
21444  if (!SWIG_IsOK(ecode5)) {
21445  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'");
21446  }
21447  arg5 = static_cast< size_t >(val5);
21448  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
21449  if (!SWIG_IsOK(res6)) {
21450  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
21451  }
21452  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
21453  ecode7 = SWIG_AsVal_bool(obj6, &val7);
21454  if (!SWIG_IsOK(ecode7)) {
21455  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search" "', argument " "7"" of type '" "bool""'");
21456  }
21457  arg7 = static_cast< bool >(val7);
21458  {
21459  Py_BEGIN_ALLOW_THREADS
21460  try {
21461  ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7);
21462  } catch(faiss::FaissException & e) {
21463  PyEval_RestoreThread(_save);
21464 
21465  if (PyErr_Occurred()) {
21466  // some previous code already set the error type.
21467  } else {
21468  PyErr_SetString(PyExc_RuntimeError, e.what());
21469  }
21470  SWIG_fail;
21471  }
21472  Py_END_ALLOW_THREADS
21473  }
21474  resultobj = SWIG_Py_Void();
21475  return resultobj;
21476 fail:
21477  return NULL;
21478 }
21479 
21480 
21481 SWIGINTERN PyObject *_wrap_ProductQuantizer_search__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21482  PyObject *resultobj = 0;
21484  float *arg2 = (float *) 0 ;
21485  size_t arg3 ;
21486  uint8_t *arg4 = (uint8_t *) 0 ;
21487  size_t arg5 ;
21489  void *argp1 = 0 ;
21490  int res1 = 0 ;
21491  void *argp2 = 0 ;
21492  int res2 = 0 ;
21493  size_t val3 ;
21494  int ecode3 = 0 ;
21495  void *argp4 = 0 ;
21496  int res4 = 0 ;
21497  size_t val5 ;
21498  int ecode5 = 0 ;
21499  void *argp6 = 0 ;
21500  int res6 = 0 ;
21501  PyObject * obj0 = 0 ;
21502  PyObject * obj1 = 0 ;
21503  PyObject * obj2 = 0 ;
21504  PyObject * obj3 = 0 ;
21505  PyObject * obj4 = 0 ;
21506  PyObject * obj5 = 0 ;
21507 
21508  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
21509  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21510  if (!SWIG_IsOK(res1)) {
21511  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21512  }
21513  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21514  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21515  if (!SWIG_IsOK(res2)) {
21516  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search" "', argument " "2"" of type '" "float const *""'");
21517  }
21518  arg2 = reinterpret_cast< float * >(argp2);
21519  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
21520  if (!SWIG_IsOK(ecode3)) {
21521  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search" "', argument " "3"" of type '" "size_t""'");
21522  }
21523  arg3 = static_cast< size_t >(val3);
21524  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
21525  if (!SWIG_IsOK(res4)) {
21526  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search" "', argument " "4"" of type '" "uint8_t const *""'");
21527  }
21528  arg4 = reinterpret_cast< uint8_t * >(argp4);
21529  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
21530  if (!SWIG_IsOK(ecode5)) {
21531  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search" "', argument " "5"" of type '" "size_t""'");
21532  }
21533  arg5 = static_cast< size_t >(val5);
21534  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
21535  if (!SWIG_IsOK(res6)) {
21536  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
21537  }
21538  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
21539  {
21540  Py_BEGIN_ALLOW_THREADS
21541  try {
21542  ((faiss::ProductQuantizer const *)arg1)->search((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6);
21543  } catch(faiss::FaissException & e) {
21544  PyEval_RestoreThread(_save);
21545 
21546  if (PyErr_Occurred()) {
21547  // some previous code already set the error type.
21548  } else {
21549  PyErr_SetString(PyExc_RuntimeError, e.what());
21550  }
21551  SWIG_fail;
21552  }
21553  Py_END_ALLOW_THREADS
21554  }
21555  resultobj = SWIG_Py_Void();
21556  return resultobj;
21557 fail:
21558  return NULL;
21559 }
21560 
21561 
21562 SWIGINTERN PyObject *_wrap_ProductQuantizer_search(PyObject *self, PyObject *args) {
21563  Py_ssize_t argc;
21564  PyObject *argv[8] = {
21565  0
21566  };
21567  Py_ssize_t ii;
21568 
21569  if (!PyTuple_Check(args)) SWIG_fail;
21570  argc = args ? PyObject_Length(args) : 0;
21571  for (ii = 0; (ii < 7) && (ii < argc); ii++) {
21572  argv[ii] = PyTuple_GET_ITEM(args,ii);
21573  }
21574  if (argc == 6) {
21575  int _v;
21576  void *vptr = 0;
21577  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21578  _v = SWIG_CheckState(res);
21579  if (_v) {
21580  void *vptr = 0;
21581  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0);
21582  _v = SWIG_CheckState(res);
21583  if (_v) {
21584  {
21585  int res = SWIG_AsVal_size_t(argv[2], NULL);
21586  _v = SWIG_CheckState(res);
21587  }
21588  if (_v) {
21589  void *vptr = 0;
21590  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
21591  _v = SWIG_CheckState(res);
21592  if (_v) {
21593  {
21594  int res = SWIG_AsVal_size_t(argv[4], NULL);
21595  _v = SWIG_CheckState(res);
21596  }
21597  if (_v) {
21598  void *vptr = 0;
21599  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0);
21600  _v = SWIG_CheckState(res);
21601  if (_v) {
21602  return _wrap_ProductQuantizer_search__SWIG_1(self, args);
21603  }
21604  }
21605  }
21606  }
21607  }
21608  }
21609  }
21610  if (argc == 7) {
21611  int _v;
21612  void *vptr = 0;
21613  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21614  _v = SWIG_CheckState(res);
21615  if (_v) {
21616  void *vptr = 0;
21617  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0);
21618  _v = SWIG_CheckState(res);
21619  if (_v) {
21620  {
21621  int res = SWIG_AsVal_size_t(argv[2], NULL);
21622  _v = SWIG_CheckState(res);
21623  }
21624  if (_v) {
21625  void *vptr = 0;
21626  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
21627  _v = SWIG_CheckState(res);
21628  if (_v) {
21629  {
21630  int res = SWIG_AsVal_size_t(argv[4], NULL);
21631  _v = SWIG_CheckState(res);
21632  }
21633  if (_v) {
21634  void *vptr = 0;
21635  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0);
21636  _v = SWIG_CheckState(res);
21637  if (_v) {
21638  {
21639  int res = SWIG_AsVal_bool(argv[6], NULL);
21640  _v = SWIG_CheckState(res);
21641  }
21642  if (_v) {
21643  return _wrap_ProductQuantizer_search__SWIG_0(self, args);
21644  }
21645  }
21646  }
21647  }
21648  }
21649  }
21650  }
21651  }
21652 
21653 fail:
21654  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search'.\n"
21655  " Possible C/C++ prototypes are:\n"
21656  " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n"
21657  " faiss::ProductQuantizer::search(float const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n");
21658  return 0;
21659 }
21660 
21661 
21662 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21663  PyObject *resultobj = 0;
21665  float *arg2 = (float *) 0 ;
21666  size_t arg3 ;
21667  uint8_t *arg4 = (uint8_t *) 0 ;
21668  size_t arg5 ;
21670  bool arg7 ;
21671  void *argp1 = 0 ;
21672  int res1 = 0 ;
21673  void *argp2 = 0 ;
21674  int res2 = 0 ;
21675  size_t val3 ;
21676  int ecode3 = 0 ;
21677  void *argp4 = 0 ;
21678  int res4 = 0 ;
21679  size_t val5 ;
21680  int ecode5 = 0 ;
21681  void *argp6 = 0 ;
21682  int res6 = 0 ;
21683  bool val7 ;
21684  int ecode7 = 0 ;
21685  PyObject * obj0 = 0 ;
21686  PyObject * obj1 = 0 ;
21687  PyObject * obj2 = 0 ;
21688  PyObject * obj3 = 0 ;
21689  PyObject * obj4 = 0 ;
21690  PyObject * obj5 = 0 ;
21691  PyObject * obj6 = 0 ;
21692 
21693  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
21694  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21695  if (!SWIG_IsOK(res1)) {
21696  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21697  }
21698  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21699  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21700  if (!SWIG_IsOK(res2)) {
21701  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'");
21702  }
21703  arg2 = reinterpret_cast< float * >(argp2);
21704  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
21705  if (!SWIG_IsOK(ecode3)) {
21706  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'");
21707  }
21708  arg3 = static_cast< size_t >(val3);
21709  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
21710  if (!SWIG_IsOK(res4)) {
21711  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'");
21712  }
21713  arg4 = reinterpret_cast< uint8_t * >(argp4);
21714  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
21715  if (!SWIG_IsOK(ecode5)) {
21716  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'");
21717  }
21718  arg5 = static_cast< size_t >(val5);
21719  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 );
21720  if (!SWIG_IsOK(res6)) {
21721  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'");
21722  }
21723  arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6);
21724  ecode7 = SWIG_AsVal_bool(obj6, &val7);
21725  if (!SWIG_IsOK(ecode7)) {
21726  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_ip" "', argument " "7"" of type '" "bool""'");
21727  }
21728  arg7 = static_cast< bool >(val7);
21729  {
21730  Py_BEGIN_ALLOW_THREADS
21731  try {
21732  ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7);
21733  } catch(faiss::FaissException & e) {
21734  PyEval_RestoreThread(_save);
21735 
21736  if (PyErr_Occurred()) {
21737  // some previous code already set the error type.
21738  } else {
21739  PyErr_SetString(PyExc_RuntimeError, e.what());
21740  }
21741  SWIG_fail;
21742  }
21743  Py_END_ALLOW_THREADS
21744  }
21745  resultobj = SWIG_Py_Void();
21746  return resultobj;
21747 fail:
21748  return NULL;
21749 }
21750 
21751 
21752 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21753  PyObject *resultobj = 0;
21755  float *arg2 = (float *) 0 ;
21756  size_t arg3 ;
21757  uint8_t *arg4 = (uint8_t *) 0 ;
21758  size_t arg5 ;
21760  void *argp1 = 0 ;
21761  int res1 = 0 ;
21762  void *argp2 = 0 ;
21763  int res2 = 0 ;
21764  size_t val3 ;
21765  int ecode3 = 0 ;
21766  void *argp4 = 0 ;
21767  int res4 = 0 ;
21768  size_t val5 ;
21769  int ecode5 = 0 ;
21770  void *argp6 = 0 ;
21771  int res6 = 0 ;
21772  PyObject * obj0 = 0 ;
21773  PyObject * obj1 = 0 ;
21774  PyObject * obj2 = 0 ;
21775  PyObject * obj3 = 0 ;
21776  PyObject * obj4 = 0 ;
21777  PyObject * obj5 = 0 ;
21778 
21779  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_ip",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
21780  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21781  if (!SWIG_IsOK(res1)) {
21782  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_ip" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
21783  }
21784  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21785  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 );
21786  if (!SWIG_IsOK(res2)) {
21787  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_ip" "', argument " "2"" of type '" "float const *""'");
21788  }
21789  arg2 = reinterpret_cast< float * >(argp2);
21790  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
21791  if (!SWIG_IsOK(ecode3)) {
21792  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_ip" "', argument " "3"" of type '" "size_t""'");
21793  }
21794  arg3 = static_cast< size_t >(val3);
21795  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
21796  if (!SWIG_IsOK(res4)) {
21797  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_ip" "', argument " "4"" of type '" "uint8_t const *""'");
21798  }
21799  arg4 = reinterpret_cast< uint8_t * >(argp4);
21800  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
21801  if (!SWIG_IsOK(ecode5)) {
21802  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_ip" "', argument " "5"" of type '" "size_t""'");
21803  }
21804  arg5 = static_cast< size_t >(val5);
21805  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0 | 0 );
21806  if (!SWIG_IsOK(res6)) {
21807  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_ip" "', argument " "6"" of type '" "faiss::float_minheap_array_t *""'");
21808  }
21809  arg6 = reinterpret_cast< faiss::float_minheap_array_t * >(argp6);
21810  {
21811  Py_BEGIN_ALLOW_THREADS
21812  try {
21813  ((faiss::ProductQuantizer const *)arg1)->search_ip((float const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6);
21814  } catch(faiss::FaissException & e) {
21815  PyEval_RestoreThread(_save);
21816 
21817  if (PyErr_Occurred()) {
21818  // some previous code already set the error type.
21819  } else {
21820  PyErr_SetString(PyExc_RuntimeError, e.what());
21821  }
21822  SWIG_fail;
21823  }
21824  Py_END_ALLOW_THREADS
21825  }
21826  resultobj = SWIG_Py_Void();
21827  return resultobj;
21828 fail:
21829  return NULL;
21830 }
21831 
21832 
21833 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_ip(PyObject *self, PyObject *args) {
21834  Py_ssize_t argc;
21835  PyObject *argv[8] = {
21836  0
21837  };
21838  Py_ssize_t ii;
21839 
21840  if (!PyTuple_Check(args)) SWIG_fail;
21841  argc = args ? PyObject_Length(args) : 0;
21842  for (ii = 0; (ii < 7) && (ii < argc); ii++) {
21843  argv[ii] = PyTuple_GET_ITEM(args,ii);
21844  }
21845  if (argc == 6) {
21846  int _v;
21847  void *vptr = 0;
21848  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21849  _v = SWIG_CheckState(res);
21850  if (_v) {
21851  void *vptr = 0;
21852  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0);
21853  _v = SWIG_CheckState(res);
21854  if (_v) {
21855  {
21856  int res = SWIG_AsVal_size_t(argv[2], NULL);
21857  _v = SWIG_CheckState(res);
21858  }
21859  if (_v) {
21860  void *vptr = 0;
21861  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
21862  _v = SWIG_CheckState(res);
21863  if (_v) {
21864  {
21865  int res = SWIG_AsVal_size_t(argv[4], NULL);
21866  _v = SWIG_CheckState(res);
21867  }
21868  if (_v) {
21869  void *vptr = 0;
21870  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0);
21871  _v = SWIG_CheckState(res);
21872  if (_v) {
21873  return _wrap_ProductQuantizer_search_ip__SWIG_1(self, args);
21874  }
21875  }
21876  }
21877  }
21878  }
21879  }
21880  }
21881  if (argc == 7) {
21882  int _v;
21883  void *vptr = 0;
21884  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
21885  _v = SWIG_CheckState(res);
21886  if (_v) {
21887  void *vptr = 0;
21888  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_float, 0);
21889  _v = SWIG_CheckState(res);
21890  if (_v) {
21891  {
21892  int res = SWIG_AsVal_size_t(argv[2], NULL);
21893  _v = SWIG_CheckState(res);
21894  }
21895  if (_v) {
21896  void *vptr = 0;
21897  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
21898  _v = SWIG_CheckState(res);
21899  if (_v) {
21900  {
21901  int res = SWIG_AsVal_size_t(argv[4], NULL);
21902  _v = SWIG_CheckState(res);
21903  }
21904  if (_v) {
21905  void *vptr = 0;
21906  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMinT_float_long_t_t, 0);
21907  _v = SWIG_CheckState(res);
21908  if (_v) {
21909  {
21910  int res = SWIG_AsVal_bool(argv[6], NULL);
21911  _v = SWIG_CheckState(res);
21912  }
21913  if (_v) {
21914  return _wrap_ProductQuantizer_search_ip__SWIG_0(self, args);
21915  }
21916  }
21917  }
21918  }
21919  }
21920  }
21921  }
21922  }
21923 
21924 fail:
21925  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_ip'.\n"
21926  " Possible C/C++ prototypes are:\n"
21927  " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *,bool) const\n"
21928  " faiss::ProductQuantizer::search_ip(float const *,size_t,uint8_t const *,size_t const,faiss::float_minheap_array_t *) const\n");
21929  return 0;
21930 }
21931 
21932 
21933 SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21934  PyObject *resultobj = 0;
21936  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
21937  void *argp1 = 0 ;
21938  int res1 = 0 ;
21939  void *argp2 = 0 ;
21940  int res2 = 0 ;
21941  PyObject * obj0 = 0 ;
21942  PyObject * obj1 = 0 ;
21943 
21944  if (!PyArg_ParseTuple(args,(char *)"OO:ProductQuantizer_sdc_table_set",&obj0,&obj1)) SWIG_fail;
21945  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21946  if (!SWIG_IsOK(res1)) {
21947  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
21948  }
21949  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21950  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
21951  if (!SWIG_IsOK(res2)) {
21952  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_sdc_table_set" "', argument " "2"" of type '" "std::vector< float > *""'");
21953  }
21954  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
21955  if (arg1) (arg1)->sdc_table = *arg2;
21956  resultobj = SWIG_Py_Void();
21957  return resultobj;
21958 fail:
21959  return NULL;
21960 }
21961 
21962 
21963 SWIGINTERN PyObject *_wrap_ProductQuantizer_sdc_table_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21964  PyObject *resultobj = 0;
21966  void *argp1 = 0 ;
21967  int res1 = 0 ;
21968  PyObject * obj0 = 0 ;
21969  std::vector< float > *result = 0 ;
21970 
21971  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_sdc_table_get",&obj0)) SWIG_fail;
21972  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21973  if (!SWIG_IsOK(res1)) {
21974  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_sdc_table_get" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
21975  }
21976  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21977  result = (std::vector< float > *)& ((arg1)->sdc_table);
21978  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
21979  return resultobj;
21980 fail:
21981  return NULL;
21982 }
21983 
21984 
21985 SWIGINTERN PyObject *_wrap_ProductQuantizer_compute_sdc_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21986  PyObject *resultobj = 0;
21988  void *argp1 = 0 ;
21989  int res1 = 0 ;
21990  PyObject * obj0 = 0 ;
21991 
21992  if (!PyArg_ParseTuple(args,(char *)"O:ProductQuantizer_compute_sdc_table",&obj0)) SWIG_fail;
21993  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
21994  if (!SWIG_IsOK(res1)) {
21995  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_compute_sdc_table" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
21996  }
21997  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
21998  {
21999  Py_BEGIN_ALLOW_THREADS
22000  try {
22001  (arg1)->compute_sdc_table();
22002  } catch(faiss::FaissException & e) {
22003  PyEval_RestoreThread(_save);
22004 
22005  if (PyErr_Occurred()) {
22006  // some previous code already set the error type.
22007  } else {
22008  PyErr_SetString(PyExc_RuntimeError, e.what());
22009  }
22010  SWIG_fail;
22011  }
22012  Py_END_ALLOW_THREADS
22013  }
22014  resultobj = SWIG_Py_Void();
22015  return resultobj;
22016 fail:
22017  return NULL;
22018 }
22019 
22020 
22021 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22022  PyObject *resultobj = 0;
22024  uint8_t *arg2 = (uint8_t *) 0 ;
22025  size_t arg3 ;
22026  uint8_t *arg4 = (uint8_t *) 0 ;
22027  size_t arg5 ;
22029  bool arg7 ;
22030  void *argp1 = 0 ;
22031  int res1 = 0 ;
22032  void *argp2 = 0 ;
22033  int res2 = 0 ;
22034  size_t val3 ;
22035  int ecode3 = 0 ;
22036  void *argp4 = 0 ;
22037  int res4 = 0 ;
22038  size_t val5 ;
22039  int ecode5 = 0 ;
22040  void *argp6 = 0 ;
22041  int res6 = 0 ;
22042  bool val7 ;
22043  int ecode7 = 0 ;
22044  PyObject * obj0 = 0 ;
22045  PyObject * obj1 = 0 ;
22046  PyObject * obj2 = 0 ;
22047  PyObject * obj3 = 0 ;
22048  PyObject * obj4 = 0 ;
22049  PyObject * obj5 = 0 ;
22050  PyObject * obj6 = 0 ;
22051 
22052  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
22053  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
22054  if (!SWIG_IsOK(res1)) {
22055  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
22056  }
22057  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
22058  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
22059  if (!SWIG_IsOK(res2)) {
22060  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'");
22061  }
22062  arg2 = reinterpret_cast< uint8_t * >(argp2);
22063  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
22064  if (!SWIG_IsOK(ecode3)) {
22065  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'");
22066  }
22067  arg3 = static_cast< size_t >(val3);
22068  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
22069  if (!SWIG_IsOK(res4)) {
22070  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'");
22071  }
22072  arg4 = reinterpret_cast< uint8_t * >(argp4);
22073  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
22074  if (!SWIG_IsOK(ecode5)) {
22075  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'");
22076  }
22077  arg5 = static_cast< size_t >(val5);
22078  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
22079  if (!SWIG_IsOK(res6)) {
22080  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
22081  }
22082  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
22083  ecode7 = SWIG_AsVal_bool(obj6, &val7);
22084  if (!SWIG_IsOK(ecode7)) {
22085  SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ProductQuantizer_search_sdc" "', argument " "7"" of type '" "bool""'");
22086  }
22087  arg7 = static_cast< bool >(val7);
22088  {
22089  Py_BEGIN_ALLOW_THREADS
22090  try {
22091  ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6,arg7);
22092  } catch(faiss::FaissException & e) {
22093  PyEval_RestoreThread(_save);
22094 
22095  if (PyErr_Occurred()) {
22096  // some previous code already set the error type.
22097  } else {
22098  PyErr_SetString(PyExc_RuntimeError, e.what());
22099  }
22100  SWIG_fail;
22101  }
22102  Py_END_ALLOW_THREADS
22103  }
22104  resultobj = SWIG_Py_Void();
22105  return resultobj;
22106 fail:
22107  return NULL;
22108 }
22109 
22110 
22111 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22112  PyObject *resultobj = 0;
22114  uint8_t *arg2 = (uint8_t *) 0 ;
22115  size_t arg3 ;
22116  uint8_t *arg4 = (uint8_t *) 0 ;
22117  size_t arg5 ;
22119  void *argp1 = 0 ;
22120  int res1 = 0 ;
22121  void *argp2 = 0 ;
22122  int res2 = 0 ;
22123  size_t val3 ;
22124  int ecode3 = 0 ;
22125  void *argp4 = 0 ;
22126  int res4 = 0 ;
22127  size_t val5 ;
22128  int ecode5 = 0 ;
22129  void *argp6 = 0 ;
22130  int res6 = 0 ;
22131  PyObject * obj0 = 0 ;
22132  PyObject * obj1 = 0 ;
22133  PyObject * obj2 = 0 ;
22134  PyObject * obj3 = 0 ;
22135  PyObject * obj4 = 0 ;
22136  PyObject * obj5 = 0 ;
22137 
22138  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:ProductQuantizer_search_sdc",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
22139  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
22140  if (!SWIG_IsOK(res1)) {
22141  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ProductQuantizer_search_sdc" "', argument " "1"" of type '" "faiss::ProductQuantizer const *""'");
22142  }
22143  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
22144  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 );
22145  if (!SWIG_IsOK(res2)) {
22146  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ProductQuantizer_search_sdc" "', argument " "2"" of type '" "uint8_t const *""'");
22147  }
22148  arg2 = reinterpret_cast< uint8_t * >(argp2);
22149  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
22150  if (!SWIG_IsOK(ecode3)) {
22151  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ProductQuantizer_search_sdc" "', argument " "3"" of type '" "size_t""'");
22152  }
22153  arg3 = static_cast< size_t >(val3);
22154  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 );
22155  if (!SWIG_IsOK(res4)) {
22156  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ProductQuantizer_search_sdc" "', argument " "4"" of type '" "uint8_t const *""'");
22157  }
22158  arg4 = reinterpret_cast< uint8_t * >(argp4);
22159  ecode5 = SWIG_AsVal_size_t(obj4, &val5);
22160  if (!SWIG_IsOK(ecode5)) {
22161  SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ProductQuantizer_search_sdc" "', argument " "5"" of type '" "size_t""'");
22162  }
22163  arg5 = static_cast< size_t >(val5);
22164  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0 | 0 );
22165  if (!SWIG_IsOK(res6)) {
22166  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "ProductQuantizer_search_sdc" "', argument " "6"" of type '" "faiss::float_maxheap_array_t *""'");
22167  }
22168  arg6 = reinterpret_cast< faiss::float_maxheap_array_t * >(argp6);
22169  {
22170  Py_BEGIN_ALLOW_THREADS
22171  try {
22172  ((faiss::ProductQuantizer const *)arg1)->search_sdc((uint8_t const *)arg2,arg3,(uint8_t const *)arg4,arg5,arg6);
22173  } catch(faiss::FaissException & e) {
22174  PyEval_RestoreThread(_save);
22175 
22176  if (PyErr_Occurred()) {
22177  // some previous code already set the error type.
22178  } else {
22179  PyErr_SetString(PyExc_RuntimeError, e.what());
22180  }
22181  SWIG_fail;
22182  }
22183  Py_END_ALLOW_THREADS
22184  }
22185  resultobj = SWIG_Py_Void();
22186  return resultobj;
22187 fail:
22188  return NULL;
22189 }
22190 
22191 
22192 SWIGINTERN PyObject *_wrap_ProductQuantizer_search_sdc(PyObject *self, PyObject *args) {
22193  Py_ssize_t argc;
22194  PyObject *argv[8] = {
22195  0
22196  };
22197  Py_ssize_t ii;
22198 
22199  if (!PyTuple_Check(args)) SWIG_fail;
22200  argc = args ? PyObject_Length(args) : 0;
22201  for (ii = 0; (ii < 7) && (ii < argc); ii++) {
22202  argv[ii] = PyTuple_GET_ITEM(args,ii);
22203  }
22204  if (argc == 6) {
22205  int _v;
22206  void *vptr = 0;
22207  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
22208  _v = SWIG_CheckState(res);
22209  if (_v) {
22210  void *vptr = 0;
22211  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
22212  _v = SWIG_CheckState(res);
22213  if (_v) {
22214  {
22215  int res = SWIG_AsVal_size_t(argv[2], NULL);
22216  _v = SWIG_CheckState(res);
22217  }
22218  if (_v) {
22219  void *vptr = 0;
22220  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
22221  _v = SWIG_CheckState(res);
22222  if (_v) {
22223  {
22224  int res = SWIG_AsVal_size_t(argv[4], NULL);
22225  _v = SWIG_CheckState(res);
22226  }
22227  if (_v) {
22228  void *vptr = 0;
22229  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0);
22230  _v = SWIG_CheckState(res);
22231  if (_v) {
22232  return _wrap_ProductQuantizer_search_sdc__SWIG_1(self, args);
22233  }
22234  }
22235  }
22236  }
22237  }
22238  }
22239  }
22240  if (argc == 7) {
22241  int _v;
22242  void *vptr = 0;
22243  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__ProductQuantizer, 0);
22244  _v = SWIG_CheckState(res);
22245  if (_v) {
22246  void *vptr = 0;
22247  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_unsigned_char, 0);
22248  _v = SWIG_CheckState(res);
22249  if (_v) {
22250  {
22251  int res = SWIG_AsVal_size_t(argv[2], NULL);
22252  _v = SWIG_CheckState(res);
22253  }
22254  if (_v) {
22255  void *vptr = 0;
22256  int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_unsigned_char, 0);
22257  _v = SWIG_CheckState(res);
22258  if (_v) {
22259  {
22260  int res = SWIG_AsVal_size_t(argv[4], NULL);
22261  _v = SWIG_CheckState(res);
22262  }
22263  if (_v) {
22264  void *vptr = 0;
22265  int res = SWIG_ConvertPtr(argv[5], &vptr, SWIGTYPE_p_faiss__HeapArrayT_faiss__CMaxT_float_long_t_t, 0);
22266  _v = SWIG_CheckState(res);
22267  if (_v) {
22268  {
22269  int res = SWIG_AsVal_bool(argv[6], NULL);
22270  _v = SWIG_CheckState(res);
22271  }
22272  if (_v) {
22273  return _wrap_ProductQuantizer_search_sdc__SWIG_0(self, args);
22274  }
22275  }
22276  }
22277  }
22278  }
22279  }
22280  }
22281  }
22282 
22283 fail:
22284  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ProductQuantizer_search_sdc'.\n"
22285  " Possible C/C++ prototypes are:\n"
22286  " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *,bool) const\n"
22287  " faiss::ProductQuantizer::search_sdc(uint8_t const *,size_t,uint8_t const *,size_t const,faiss::float_maxheap_array_t *) const\n");
22288  return 0;
22289 }
22290 
22291 
22292 SWIGINTERN PyObject *_wrap_delete_ProductQuantizer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22293  PyObject *resultobj = 0;
22295  void *argp1 = 0 ;
22296  int res1 = 0 ;
22297  PyObject * obj0 = 0 ;
22298 
22299  if (!PyArg_ParseTuple(args,(char *)"O:delete_ProductQuantizer",&obj0)) SWIG_fail;
22300  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 );
22301  if (!SWIG_IsOK(res1)) {
22302  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ProductQuantizer" "', argument " "1"" of type '" "faiss::ProductQuantizer *""'");
22303  }
22304  arg1 = reinterpret_cast< faiss::ProductQuantizer * >(argp1);
22305  delete arg1;
22306  resultobj = SWIG_Py_Void();
22307  return resultobj;
22308 fail:
22309  return NULL;
22310 }
22311 
22312 
22313 SWIGINTERN PyObject *ProductQuantizer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22314  PyObject *obj;
22315  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
22316  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__ProductQuantizer, SWIG_NewClientData(obj));
22317  return SWIG_Py_Void();
22318 }
22319 
22320 SWIGINTERN PyObject *_wrap_VectorTransform_d_in_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22321  PyObject *resultobj = 0;
22323  int arg2 ;
22324  void *argp1 = 0 ;
22325  int res1 = 0 ;
22326  int val2 ;
22327  int ecode2 = 0 ;
22328  PyObject * obj0 = 0 ;
22329  PyObject * obj1 = 0 ;
22330 
22331  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_in_set",&obj0,&obj1)) SWIG_fail;
22332  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22333  if (!SWIG_IsOK(res1)) {
22334  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22335  }
22336  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22337  ecode2 = SWIG_AsVal_int(obj1, &val2);
22338  if (!SWIG_IsOK(ecode2)) {
22339  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_in_set" "', argument " "2"" of type '" "int""'");
22340  }
22341  arg2 = static_cast< int >(val2);
22342  if (arg1) (arg1)->d_in = arg2;
22343  resultobj = SWIG_Py_Void();
22344  return resultobj;
22345 fail:
22346  return NULL;
22347 }
22348 
22349 
22350 SWIGINTERN PyObject *_wrap_VectorTransform_d_in_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22351  PyObject *resultobj = 0;
22353  void *argp1 = 0 ;
22354  int res1 = 0 ;
22355  PyObject * obj0 = 0 ;
22356  int result;
22357 
22358  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_in_get",&obj0)) SWIG_fail;
22359  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22360  if (!SWIG_IsOK(res1)) {
22361  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_in_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22362  }
22363  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22364  result = (int) ((arg1)->d_in);
22365  resultobj = SWIG_From_int(static_cast< int >(result));
22366  return resultobj;
22367 fail:
22368  return NULL;
22369 }
22370 
22371 
22372 SWIGINTERN PyObject *_wrap_VectorTransform_d_out_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22373  PyObject *resultobj = 0;
22375  int arg2 ;
22376  void *argp1 = 0 ;
22377  int res1 = 0 ;
22378  int val2 ;
22379  int ecode2 = 0 ;
22380  PyObject * obj0 = 0 ;
22381  PyObject * obj1 = 0 ;
22382 
22383  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_d_out_set",&obj0,&obj1)) SWIG_fail;
22384  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22385  if (!SWIG_IsOK(res1)) {
22386  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22387  }
22388  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22389  ecode2 = SWIG_AsVal_int(obj1, &val2);
22390  if (!SWIG_IsOK(ecode2)) {
22391  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_d_out_set" "', argument " "2"" of type '" "int""'");
22392  }
22393  arg2 = static_cast< int >(val2);
22394  if (arg1) (arg1)->d_out = arg2;
22395  resultobj = SWIG_Py_Void();
22396  return resultobj;
22397 fail:
22398  return NULL;
22399 }
22400 
22401 
22402 SWIGINTERN PyObject *_wrap_VectorTransform_d_out_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22403  PyObject *resultobj = 0;
22405  void *argp1 = 0 ;
22406  int res1 = 0 ;
22407  PyObject * obj0 = 0 ;
22408  int result;
22409 
22410  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_d_out_get",&obj0)) SWIG_fail;
22411  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22412  if (!SWIG_IsOK(res1)) {
22413  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_d_out_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22414  }
22415  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22416  result = (int) ((arg1)->d_out);
22417  resultobj = SWIG_From_int(static_cast< int >(result));
22418  return resultobj;
22419 fail:
22420  return NULL;
22421 }
22422 
22423 
22424 SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22425  PyObject *resultobj = 0;
22427  bool arg2 ;
22428  void *argp1 = 0 ;
22429  int res1 = 0 ;
22430  bool val2 ;
22431  int ecode2 = 0 ;
22432  PyObject * obj0 = 0 ;
22433  PyObject * obj1 = 0 ;
22434 
22435  if (!PyArg_ParseTuple(args,(char *)"OO:VectorTransform_is_trained_set",&obj0,&obj1)) SWIG_fail;
22436  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22437  if (!SWIG_IsOK(res1)) {
22438  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_set" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22439  }
22440  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22441  ecode2 = SWIG_AsVal_bool(obj1, &val2);
22442  if (!SWIG_IsOK(ecode2)) {
22443  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_is_trained_set" "', argument " "2"" of type '" "bool""'");
22444  }
22445  arg2 = static_cast< bool >(val2);
22446  if (arg1) (arg1)->is_trained = arg2;
22447  resultobj = SWIG_Py_Void();
22448  return resultobj;
22449 fail:
22450  return NULL;
22451 }
22452 
22453 
22454 SWIGINTERN PyObject *_wrap_VectorTransform_is_trained_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22455  PyObject *resultobj = 0;
22457  void *argp1 = 0 ;
22458  int res1 = 0 ;
22459  PyObject * obj0 = 0 ;
22460  bool result;
22461 
22462  if (!PyArg_ParseTuple(args,(char *)"O:VectorTransform_is_trained_get",&obj0)) SWIG_fail;
22463  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22464  if (!SWIG_IsOK(res1)) {
22465  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_is_trained_get" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22466  }
22467  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22468  result = (bool) ((arg1)->is_trained);
22469  resultobj = SWIG_From_bool(static_cast< bool >(result));
22470  return resultobj;
22471 fail:
22472  return NULL;
22473 }
22474 
22475 
22476 SWIGINTERN PyObject *_wrap_VectorTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22477  PyObject *resultobj = 0;
22479  faiss::VectorTransform::idx_t arg2 ;
22480  float *arg3 = (float *) 0 ;
22481  void *argp1 = 0 ;
22482  int res1 = 0 ;
22483  long val2 ;
22484  int ecode2 = 0 ;
22485  void *argp3 = 0 ;
22486  int res3 = 0 ;
22487  PyObject * obj0 = 0 ;
22488  PyObject * obj1 = 0 ;
22489  PyObject * obj2 = 0 ;
22490 
22491  if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_train",&obj0,&obj1,&obj2)) SWIG_fail;
22492  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22493  if (!SWIG_IsOK(res1)) {
22494  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_train" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22495  }
22496  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22497  ecode2 = SWIG_AsVal_long(obj1, &val2);
22498  if (!SWIG_IsOK(ecode2)) {
22499  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_train" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
22500  }
22501  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
22502  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
22503  if (!SWIG_IsOK(res3)) {
22504  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_train" "', argument " "3"" of type '" "float const *""'");
22505  }
22506  arg3 = reinterpret_cast< float * >(argp3);
22507  {
22508  Py_BEGIN_ALLOW_THREADS
22509  try {
22510  (arg1)->train(arg2,(float const *)arg3);
22511  } catch(faiss::FaissException & e) {
22512  PyEval_RestoreThread(_save);
22513 
22514  if (PyErr_Occurred()) {
22515  // some previous code already set the error type.
22516  } else {
22517  PyErr_SetString(PyExc_RuntimeError, e.what());
22518  }
22519  SWIG_fail;
22520  }
22521  Py_END_ALLOW_THREADS
22522  }
22523  resultobj = SWIG_Py_Void();
22524  return resultobj;
22525 fail:
22526  return NULL;
22527 }
22528 
22529 
22530 SWIGINTERN PyObject *_wrap_VectorTransform_apply(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22531  PyObject *resultobj = 0;
22533  faiss::VectorTransform::idx_t arg2 ;
22534  float *arg3 = (float *) 0 ;
22535  void *argp1 = 0 ;
22536  int res1 = 0 ;
22537  long val2 ;
22538  int ecode2 = 0 ;
22539  void *argp3 = 0 ;
22540  int res3 = 0 ;
22541  PyObject * obj0 = 0 ;
22542  PyObject * obj1 = 0 ;
22543  PyObject * obj2 = 0 ;
22544  float *result = 0 ;
22545 
22546  if (!PyArg_ParseTuple(args,(char *)"OOO:VectorTransform_apply",&obj0,&obj1,&obj2)) SWIG_fail;
22547  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22548  if (!SWIG_IsOK(res1)) {
22549  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply" "', argument " "1"" of type '" "faiss::VectorTransform const *""'");
22550  }
22551  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22552  ecode2 = SWIG_AsVal_long(obj1, &val2);
22553  if (!SWIG_IsOK(ecode2)) {
22554  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
22555  }
22556  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
22557  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
22558  if (!SWIG_IsOK(res3)) {
22559  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply" "', argument " "3"" of type '" "float const *""'");
22560  }
22561  arg3 = reinterpret_cast< float * >(argp3);
22562  {
22563  Py_BEGIN_ALLOW_THREADS
22564  try {
22565  result = (float *)((faiss::VectorTransform const *)arg1)->apply(arg2,(float const *)arg3);
22566  } catch(faiss::FaissException & e) {
22567  PyEval_RestoreThread(_save);
22568 
22569  if (PyErr_Occurred()) {
22570  // some previous code already set the error type.
22571  } else {
22572  PyErr_SetString(PyExc_RuntimeError, e.what());
22573  }
22574  SWIG_fail;
22575  }
22576  Py_END_ALLOW_THREADS
22577  }
22578  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
22579  return resultobj;
22580 fail:
22581  return NULL;
22582 }
22583 
22584 
22585 SWIGINTERN PyObject *_wrap_VectorTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22586  PyObject *resultobj = 0;
22588  faiss::VectorTransform::idx_t arg2 ;
22589  float *arg3 = (float *) 0 ;
22590  float *arg4 = (float *) 0 ;
22591  void *argp1 = 0 ;
22592  int res1 = 0 ;
22593  long val2 ;
22594  int ecode2 = 0 ;
22595  void *argp3 = 0 ;
22596  int res3 = 0 ;
22597  void *argp4 = 0 ;
22598  int res4 = 0 ;
22599  PyObject * obj0 = 0 ;
22600  PyObject * obj1 = 0 ;
22601  PyObject * obj2 = 0 ;
22602  PyObject * obj3 = 0 ;
22603 
22604  if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
22605  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22606  if (!SWIG_IsOK(res1)) {
22607  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::VectorTransform const *""'");
22608  }
22609  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22610  ecode2 = SWIG_AsVal_long(obj1, &val2);
22611  if (!SWIG_IsOK(ecode2)) {
22612  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
22613  }
22614  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
22615  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
22616  if (!SWIG_IsOK(res3)) {
22617  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'");
22618  }
22619  arg3 = reinterpret_cast< float * >(argp3);
22620  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
22621  if (!SWIG_IsOK(res4)) {
22622  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'");
22623  }
22624  arg4 = reinterpret_cast< float * >(argp4);
22625  {
22626  Py_BEGIN_ALLOW_THREADS
22627  try {
22628  ((faiss::VectorTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4);
22629  } catch(faiss::FaissException & e) {
22630  PyEval_RestoreThread(_save);
22631 
22632  if (PyErr_Occurred()) {
22633  // some previous code already set the error type.
22634  } else {
22635  PyErr_SetString(PyExc_RuntimeError, e.what());
22636  }
22637  SWIG_fail;
22638  }
22639  Py_END_ALLOW_THREADS
22640  }
22641  resultobj = SWIG_Py_Void();
22642  return resultobj;
22643 fail:
22644  return NULL;
22645 }
22646 
22647 
22648 SWIGINTERN PyObject *_wrap_VectorTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22649  PyObject *resultobj = 0;
22651  faiss::VectorTransform::idx_t arg2 ;
22652  float *arg3 = (float *) 0 ;
22653  float *arg4 = (float *) 0 ;
22654  void *argp1 = 0 ;
22655  int res1 = 0 ;
22656  long val2 ;
22657  int ecode2 = 0 ;
22658  void *argp3 = 0 ;
22659  int res3 = 0 ;
22660  void *argp4 = 0 ;
22661  int res4 = 0 ;
22662  PyObject * obj0 = 0 ;
22663  PyObject * obj1 = 0 ;
22664  PyObject * obj2 = 0 ;
22665  PyObject * obj3 = 0 ;
22666 
22667  if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
22668  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
22669  if (!SWIG_IsOK(res1)) {
22670  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorTransform_reverse_transform" "', argument " "1"" of type '" "faiss::VectorTransform const *""'");
22671  }
22672  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22673  ecode2 = SWIG_AsVal_long(obj1, &val2);
22674  if (!SWIG_IsOK(ecode2)) {
22675  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
22676  }
22677  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
22678  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
22679  if (!SWIG_IsOK(res3)) {
22680  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'");
22681  }
22682  arg3 = reinterpret_cast< float * >(argp3);
22683  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
22684  if (!SWIG_IsOK(res4)) {
22685  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorTransform_reverse_transform" "', argument " "4"" of type '" "float *""'");
22686  }
22687  arg4 = reinterpret_cast< float * >(argp4);
22688  {
22689  Py_BEGIN_ALLOW_THREADS
22690  try {
22691  ((faiss::VectorTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4);
22692  } catch(faiss::FaissException & e) {
22693  PyEval_RestoreThread(_save);
22694 
22695  if (PyErr_Occurred()) {
22696  // some previous code already set the error type.
22697  } else {
22698  PyErr_SetString(PyExc_RuntimeError, e.what());
22699  }
22700  SWIG_fail;
22701  }
22702  Py_END_ALLOW_THREADS
22703  }
22704  resultobj = SWIG_Py_Void();
22705  return resultobj;
22706 fail:
22707  return NULL;
22708 }
22709 
22710 
22711 SWIGINTERN PyObject *_wrap_delete_VectorTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22712  PyObject *resultobj = 0;
22714  void *argp1 = 0 ;
22715  int res1 = 0 ;
22716  PyObject * obj0 = 0 ;
22717 
22718  if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorTransform",&obj0)) SWIG_fail;
22719  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, SWIG_POINTER_DISOWN | 0 );
22720  if (!SWIG_IsOK(res1)) {
22721  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
22722  }
22723  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
22724  {
22725  Py_BEGIN_ALLOW_THREADS
22726  try {
22727  delete arg1;
22728  } catch(faiss::FaissException & e) {
22729  PyEval_RestoreThread(_save);
22730 
22731  if (PyErr_Occurred()) {
22732  // some previous code already set the error type.
22733  } else {
22734  PyErr_SetString(PyExc_RuntimeError, e.what());
22735  }
22736  SWIG_fail;
22737  }
22738  Py_END_ALLOW_THREADS
22739  }
22740  resultobj = SWIG_Py_Void();
22741  return resultobj;
22742 fail:
22743  return NULL;
22744 }
22745 
22746 
22747 SWIGINTERN PyObject *VectorTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22748  PyObject *obj;
22749  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
22750  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__VectorTransform, SWIG_NewClientData(obj));
22751  return SWIG_Py_Void();
22752 }
22753 
22754 SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22755  PyObject *resultobj = 0;
22757  bool arg2 ;
22758  void *argp1 = 0 ;
22759  int res1 = 0 ;
22760  bool val2 ;
22761  int ecode2 = 0 ;
22762  PyObject * obj0 = 0 ;
22763  PyObject * obj1 = 0 ;
22764 
22765  if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_have_bias_set",&obj0,&obj1)) SWIG_fail;
22766  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22767  if (!SWIG_IsOK(res1)) {
22768  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22769  }
22770  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22771  ecode2 = SWIG_AsVal_bool(obj1, &val2);
22772  if (!SWIG_IsOK(ecode2)) {
22773  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_have_bias_set" "', argument " "2"" of type '" "bool""'");
22774  }
22775  arg2 = static_cast< bool >(val2);
22776  if (arg1) (arg1)->have_bias = arg2;
22777  resultobj = SWIG_Py_Void();
22778  return resultobj;
22779 fail:
22780  return NULL;
22781 }
22782 
22783 
22784 SWIGINTERN PyObject *_wrap_LinearTransform_have_bias_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22785  PyObject *resultobj = 0;
22787  void *argp1 = 0 ;
22788  int res1 = 0 ;
22789  PyObject * obj0 = 0 ;
22790  bool result;
22791 
22792  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_have_bias_get",&obj0)) SWIG_fail;
22793  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22794  if (!SWIG_IsOK(res1)) {
22795  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_have_bias_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22796  }
22797  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22798  result = (bool) ((arg1)->have_bias);
22799  resultobj = SWIG_From_bool(static_cast< bool >(result));
22800  return resultobj;
22801 fail:
22802  return NULL;
22803 }
22804 
22805 
22806 SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22807  PyObject *resultobj = 0;
22809  bool arg2 ;
22810  void *argp1 = 0 ;
22811  int res1 = 0 ;
22812  bool val2 ;
22813  int ecode2 = 0 ;
22814  PyObject * obj0 = 0 ;
22815  PyObject * obj1 = 0 ;
22816 
22817  if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_is_orthonormal_set",&obj0,&obj1)) SWIG_fail;
22818  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22819  if (!SWIG_IsOK(res1)) {
22820  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22821  }
22822  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22823  ecode2 = SWIG_AsVal_bool(obj1, &val2);
22824  if (!SWIG_IsOK(ecode2)) {
22825  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_is_orthonormal_set" "', argument " "2"" of type '" "bool""'");
22826  }
22827  arg2 = static_cast< bool >(val2);
22828  if (arg1) (arg1)->is_orthonormal = arg2;
22829  resultobj = SWIG_Py_Void();
22830  return resultobj;
22831 fail:
22832  return NULL;
22833 }
22834 
22835 
22836 SWIGINTERN PyObject *_wrap_LinearTransform_is_orthonormal_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22837  PyObject *resultobj = 0;
22839  void *argp1 = 0 ;
22840  int res1 = 0 ;
22841  PyObject * obj0 = 0 ;
22842  bool result;
22843 
22844  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_is_orthonormal_get",&obj0)) SWIG_fail;
22845  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22846  if (!SWIG_IsOK(res1)) {
22847  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_is_orthonormal_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22848  }
22849  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22850  result = (bool) ((arg1)->is_orthonormal);
22851  resultobj = SWIG_From_bool(static_cast< bool >(result));
22852  return resultobj;
22853 fail:
22854  return NULL;
22855 }
22856 
22857 
22858 SWIGINTERN PyObject *_wrap_LinearTransform_A_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22859  PyObject *resultobj = 0;
22861  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
22862  void *argp1 = 0 ;
22863  int res1 = 0 ;
22864  void *argp2 = 0 ;
22865  int res2 = 0 ;
22866  PyObject * obj0 = 0 ;
22867  PyObject * obj1 = 0 ;
22868 
22869  if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_A_set",&obj0,&obj1)) SWIG_fail;
22870  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22871  if (!SWIG_IsOK(res1)) {
22872  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22873  }
22874  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22875  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
22876  if (!SWIG_IsOK(res2)) {
22877  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_A_set" "', argument " "2"" of type '" "std::vector< float > *""'");
22878  }
22879  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
22880  if (arg1) (arg1)->A = *arg2;
22881  resultobj = SWIG_Py_Void();
22882  return resultobj;
22883 fail:
22884  return NULL;
22885 }
22886 
22887 
22888 SWIGINTERN PyObject *_wrap_LinearTransform_A_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22889  PyObject *resultobj = 0;
22891  void *argp1 = 0 ;
22892  int res1 = 0 ;
22893  PyObject * obj0 = 0 ;
22894  std::vector< float > *result = 0 ;
22895 
22896  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_A_get",&obj0)) SWIG_fail;
22897  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22898  if (!SWIG_IsOK(res1)) {
22899  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_A_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22900  }
22901  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22902  result = (std::vector< float > *)& ((arg1)->A);
22903  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
22904  return resultobj;
22905 fail:
22906  return NULL;
22907 }
22908 
22909 
22910 SWIGINTERN PyObject *_wrap_LinearTransform_b_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22911  PyObject *resultobj = 0;
22913  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
22914  void *argp1 = 0 ;
22915  int res1 = 0 ;
22916  void *argp2 = 0 ;
22917  int res2 = 0 ;
22918  PyObject * obj0 = 0 ;
22919  PyObject * obj1 = 0 ;
22920 
22921  if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_b_set",&obj0,&obj1)) SWIG_fail;
22922  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22923  if (!SWIG_IsOK(res1)) {
22924  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22925  }
22926  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22927  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
22928  if (!SWIG_IsOK(res2)) {
22929  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LinearTransform_b_set" "', argument " "2"" of type '" "std::vector< float > *""'");
22930  }
22931  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
22932  if (arg1) (arg1)->b = *arg2;
22933  resultobj = SWIG_Py_Void();
22934  return resultobj;
22935 fail:
22936  return NULL;
22937 }
22938 
22939 
22940 SWIGINTERN PyObject *_wrap_LinearTransform_b_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22941  PyObject *resultobj = 0;
22943  void *argp1 = 0 ;
22944  int res1 = 0 ;
22945  PyObject * obj0 = 0 ;
22946  std::vector< float > *result = 0 ;
22947 
22948  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_b_get",&obj0)) SWIG_fail;
22949  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
22950  if (!SWIG_IsOK(res1)) {
22951  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_b_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
22952  }
22953  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
22954  result = (std::vector< float > *)& ((arg1)->b);
22955  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
22956  return resultobj;
22957 fail:
22958  return NULL;
22959 }
22960 
22961 
22962 SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22963  PyObject *resultobj = 0;
22964  int arg1 ;
22965  int arg2 ;
22966  bool arg3 ;
22967  int val1 ;
22968  int ecode1 = 0 ;
22969  int val2 ;
22970  int ecode2 = 0 ;
22971  bool val3 ;
22972  int ecode3 = 0 ;
22973  PyObject * obj0 = 0 ;
22974  PyObject * obj1 = 0 ;
22975  PyObject * obj2 = 0 ;
22976  faiss::LinearTransform *result = 0 ;
22977 
22978  if (!PyArg_ParseTuple(args,(char *)"OOO:new_LinearTransform",&obj0,&obj1,&obj2)) SWIG_fail;
22979  ecode1 = SWIG_AsVal_int(obj0, &val1);
22980  if (!SWIG_IsOK(ecode1)) {
22981  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'");
22982  }
22983  arg1 = static_cast< int >(val1);
22984  ecode2 = SWIG_AsVal_int(obj1, &val2);
22985  if (!SWIG_IsOK(ecode2)) {
22986  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'");
22987  }
22988  arg2 = static_cast< int >(val2);
22989  ecode3 = SWIG_AsVal_bool(obj2, &val3);
22990  if (!SWIG_IsOK(ecode3)) {
22991  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_LinearTransform" "', argument " "3"" of type '" "bool""'");
22992  }
22993  arg3 = static_cast< bool >(val3);
22994  {
22995  Py_BEGIN_ALLOW_THREADS
22996  try {
22997  result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2,arg3);
22998  } catch(faiss::FaissException & e) {
22999  PyEval_RestoreThread(_save);
23000 
23001  if (PyErr_Occurred()) {
23002  // some previous code already set the error type.
23003  } else {
23004  PyErr_SetString(PyExc_RuntimeError, e.what());
23005  }
23006  SWIG_fail;
23007  }
23008  Py_END_ALLOW_THREADS
23009  }
23010  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 );
23011  return resultobj;
23012 fail:
23013  return NULL;
23014 }
23015 
23016 
23017 SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23018  PyObject *resultobj = 0;
23019  int arg1 ;
23020  int arg2 ;
23021  int val1 ;
23022  int ecode1 = 0 ;
23023  int val2 ;
23024  int ecode2 = 0 ;
23025  PyObject * obj0 = 0 ;
23026  PyObject * obj1 = 0 ;
23027  faiss::LinearTransform *result = 0 ;
23028 
23029  if (!PyArg_ParseTuple(args,(char *)"OO:new_LinearTransform",&obj0,&obj1)) SWIG_fail;
23030  ecode1 = SWIG_AsVal_int(obj0, &val1);
23031  if (!SWIG_IsOK(ecode1)) {
23032  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'");
23033  }
23034  arg1 = static_cast< int >(val1);
23035  ecode2 = SWIG_AsVal_int(obj1, &val2);
23036  if (!SWIG_IsOK(ecode2)) {
23037  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_LinearTransform" "', argument " "2"" of type '" "int""'");
23038  }
23039  arg2 = static_cast< int >(val2);
23040  {
23041  Py_BEGIN_ALLOW_THREADS
23042  try {
23043  result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1,arg2);
23044  } catch(faiss::FaissException & e) {
23045  PyEval_RestoreThread(_save);
23046 
23047  if (PyErr_Occurred()) {
23048  // some previous code already set the error type.
23049  } else {
23050  PyErr_SetString(PyExc_RuntimeError, e.what());
23051  }
23052  SWIG_fail;
23053  }
23054  Py_END_ALLOW_THREADS
23055  }
23056  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 );
23057  return resultobj;
23058 fail:
23059  return NULL;
23060 }
23061 
23062 
23063 SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23064  PyObject *resultobj = 0;
23065  int arg1 ;
23066  int val1 ;
23067  int ecode1 = 0 ;
23068  PyObject * obj0 = 0 ;
23069  faiss::LinearTransform *result = 0 ;
23070 
23071  if (!PyArg_ParseTuple(args,(char *)"O:new_LinearTransform",&obj0)) SWIG_fail;
23072  ecode1 = SWIG_AsVal_int(obj0, &val1);
23073  if (!SWIG_IsOK(ecode1)) {
23074  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_LinearTransform" "', argument " "1"" of type '" "int""'");
23075  }
23076  arg1 = static_cast< int >(val1);
23077  {
23078  Py_BEGIN_ALLOW_THREADS
23079  try {
23080  result = (faiss::LinearTransform *)new faiss::LinearTransform(arg1);
23081  } catch(faiss::FaissException & e) {
23082  PyEval_RestoreThread(_save);
23083 
23084  if (PyErr_Occurred()) {
23085  // some previous code already set the error type.
23086  } else {
23087  PyErr_SetString(PyExc_RuntimeError, e.what());
23088  }
23089  SWIG_fail;
23090  }
23091  Py_END_ALLOW_THREADS
23092  }
23093  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 );
23094  return resultobj;
23095 fail:
23096  return NULL;
23097 }
23098 
23099 
23100 SWIGINTERN PyObject *_wrap_new_LinearTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23101  PyObject *resultobj = 0;
23102  faiss::LinearTransform *result = 0 ;
23103 
23104  if (!PyArg_ParseTuple(args,(char *)":new_LinearTransform")) SWIG_fail;
23105  {
23106  Py_BEGIN_ALLOW_THREADS
23107  try {
23109  } catch(faiss::FaissException & e) {
23110  PyEval_RestoreThread(_save);
23111 
23112  if (PyErr_Occurred()) {
23113  // some previous code already set the error type.
23114  } else {
23115  PyErr_SetString(PyExc_RuntimeError, e.what());
23116  }
23117  SWIG_fail;
23118  }
23119  Py_END_ALLOW_THREADS
23120  }
23121  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_NEW | 0 );
23122  return resultobj;
23123 fail:
23124  return NULL;
23125 }
23126 
23127 
23128 SWIGINTERN PyObject *_wrap_new_LinearTransform(PyObject *self, PyObject *args) {
23129  Py_ssize_t argc;
23130  PyObject *argv[4] = {
23131  0
23132  };
23133  Py_ssize_t ii;
23134 
23135  if (!PyTuple_Check(args)) SWIG_fail;
23136  argc = args ? PyObject_Length(args) : 0;
23137  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
23138  argv[ii] = PyTuple_GET_ITEM(args,ii);
23139  }
23140  if (argc == 0) {
23141  return _wrap_new_LinearTransform__SWIG_3(self, args);
23142  }
23143  if (argc == 1) {
23144  int _v;
23145  {
23146  int res = SWIG_AsVal_int(argv[0], NULL);
23147  _v = SWIG_CheckState(res);
23148  }
23149  if (_v) {
23150  return _wrap_new_LinearTransform__SWIG_2(self, args);
23151  }
23152  }
23153  if (argc == 2) {
23154  int _v;
23155  {
23156  int res = SWIG_AsVal_int(argv[0], NULL);
23157  _v = SWIG_CheckState(res);
23158  }
23159  if (_v) {
23160  {
23161  int res = SWIG_AsVal_int(argv[1], NULL);
23162  _v = SWIG_CheckState(res);
23163  }
23164  if (_v) {
23165  return _wrap_new_LinearTransform__SWIG_1(self, args);
23166  }
23167  }
23168  }
23169  if (argc == 3) {
23170  int _v;
23171  {
23172  int res = SWIG_AsVal_int(argv[0], NULL);
23173  _v = SWIG_CheckState(res);
23174  }
23175  if (_v) {
23176  {
23177  int res = SWIG_AsVal_int(argv[1], NULL);
23178  _v = SWIG_CheckState(res);
23179  }
23180  if (_v) {
23181  {
23182  int res = SWIG_AsVal_bool(argv[2], NULL);
23183  _v = SWIG_CheckState(res);
23184  }
23185  if (_v) {
23186  return _wrap_new_LinearTransform__SWIG_0(self, args);
23187  }
23188  }
23189  }
23190  }
23191 
23192 fail:
23193  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_LinearTransform'.\n"
23194  " Possible C/C++ prototypes are:\n"
23195  " faiss::LinearTransform::LinearTransform(int,int,bool)\n"
23196  " faiss::LinearTransform::LinearTransform(int,int)\n"
23197  " faiss::LinearTransform::LinearTransform(int)\n"
23198  " faiss::LinearTransform::LinearTransform()\n");
23199  return 0;
23200 }
23201 
23202 
23203 SWIGINTERN PyObject *_wrap_LinearTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23204  PyObject *resultobj = 0;
23206  faiss::VectorTransform::idx_t arg2 ;
23207  float *arg3 = (float *) 0 ;
23208  float *arg4 = (float *) 0 ;
23209  void *argp1 = 0 ;
23210  int res1 = 0 ;
23211  long val2 ;
23212  int ecode2 = 0 ;
23213  void *argp3 = 0 ;
23214  int res3 = 0 ;
23215  void *argp4 = 0 ;
23216  int res4 = 0 ;
23217  PyObject * obj0 = 0 ;
23218  PyObject * obj1 = 0 ;
23219  PyObject * obj2 = 0 ;
23220  PyObject * obj3 = 0 ;
23221 
23222  if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
23223  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23224  if (!SWIG_IsOK(res1)) {
23225  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::LinearTransform const *""'");
23226  }
23227  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23228  ecode2 = SWIG_AsVal_long(obj1, &val2);
23229  if (!SWIG_IsOK(ecode2)) {
23230  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
23231  }
23232  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
23233  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
23234  if (!SWIG_IsOK(res3)) {
23235  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'");
23236  }
23237  arg3 = reinterpret_cast< float * >(argp3);
23238  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
23239  if (!SWIG_IsOK(res4)) {
23240  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'");
23241  }
23242  arg4 = reinterpret_cast< float * >(argp4);
23243  {
23244  Py_BEGIN_ALLOW_THREADS
23245  try {
23246  ((faiss::LinearTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4);
23247  } catch(faiss::FaissException & e) {
23248  PyEval_RestoreThread(_save);
23249 
23250  if (PyErr_Occurred()) {
23251  // some previous code already set the error type.
23252  } else {
23253  PyErr_SetString(PyExc_RuntimeError, e.what());
23254  }
23255  SWIG_fail;
23256  }
23257  Py_END_ALLOW_THREADS
23258  }
23259  resultobj = SWIG_Py_Void();
23260  return resultobj;
23261 fail:
23262  return NULL;
23263 }
23264 
23265 
23266 SWIGINTERN PyObject *_wrap_LinearTransform_transform_transpose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23267  PyObject *resultobj = 0;
23269  faiss::VectorTransform::idx_t arg2 ;
23270  float *arg3 = (float *) 0 ;
23271  float *arg4 = (float *) 0 ;
23272  void *argp1 = 0 ;
23273  int res1 = 0 ;
23274  long val2 ;
23275  int ecode2 = 0 ;
23276  void *argp3 = 0 ;
23277  int res3 = 0 ;
23278  void *argp4 = 0 ;
23279  int res4 = 0 ;
23280  PyObject * obj0 = 0 ;
23281  PyObject * obj1 = 0 ;
23282  PyObject * obj2 = 0 ;
23283  PyObject * obj3 = 0 ;
23284 
23285  if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_transform_transpose",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
23286  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23287  if (!SWIG_IsOK(res1)) {
23288  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_transform_transpose" "', argument " "1"" of type '" "faiss::LinearTransform const *""'");
23289  }
23290  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23291  ecode2 = SWIG_AsVal_long(obj1, &val2);
23292  if (!SWIG_IsOK(ecode2)) {
23293  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_transform_transpose" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
23294  }
23295  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
23296  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
23297  if (!SWIG_IsOK(res3)) {
23298  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_transform_transpose" "', argument " "3"" of type '" "float const *""'");
23299  }
23300  arg3 = reinterpret_cast< float * >(argp3);
23301  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
23302  if (!SWIG_IsOK(res4)) {
23303  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_transform_transpose" "', argument " "4"" of type '" "float *""'");
23304  }
23305  arg4 = reinterpret_cast< float * >(argp4);
23306  {
23307  Py_BEGIN_ALLOW_THREADS
23308  try {
23309  ((faiss::LinearTransform const *)arg1)->transform_transpose(arg2,(float const *)arg3,arg4);
23310  } catch(faiss::FaissException & e) {
23311  PyEval_RestoreThread(_save);
23312 
23313  if (PyErr_Occurred()) {
23314  // some previous code already set the error type.
23315  } else {
23316  PyErr_SetString(PyExc_RuntimeError, e.what());
23317  }
23318  SWIG_fail;
23319  }
23320  Py_END_ALLOW_THREADS
23321  }
23322  resultobj = SWIG_Py_Void();
23323  return resultobj;
23324 fail:
23325  return NULL;
23326 }
23327 
23328 
23329 SWIGINTERN PyObject *_wrap_LinearTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23330  PyObject *resultobj = 0;
23332  faiss::VectorTransform::idx_t arg2 ;
23333  float *arg3 = (float *) 0 ;
23334  float *arg4 = (float *) 0 ;
23335  void *argp1 = 0 ;
23336  int res1 = 0 ;
23337  long val2 ;
23338  int ecode2 = 0 ;
23339  void *argp3 = 0 ;
23340  int res3 = 0 ;
23341  void *argp4 = 0 ;
23342  int res4 = 0 ;
23343  PyObject * obj0 = 0 ;
23344  PyObject * obj1 = 0 ;
23345  PyObject * obj2 = 0 ;
23346  PyObject * obj3 = 0 ;
23347 
23348  if (!PyArg_ParseTuple(args,(char *)"OOOO:LinearTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
23349  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23350  if (!SWIG_IsOK(res1)) {
23351  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_reverse_transform" "', argument " "1"" of type '" "faiss::LinearTransform const *""'");
23352  }
23353  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23354  ecode2 = SWIG_AsVal_long(obj1, &val2);
23355  if (!SWIG_IsOK(ecode2)) {
23356  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
23357  }
23358  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
23359  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
23360  if (!SWIG_IsOK(res3)) {
23361  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "LinearTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'");
23362  }
23363  arg3 = reinterpret_cast< float * >(argp3);
23364  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
23365  if (!SWIG_IsOK(res4)) {
23366  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "LinearTransform_reverse_transform" "', argument " "4"" of type '" "float *""'");
23367  }
23368  arg4 = reinterpret_cast< float * >(argp4);
23369  {
23370  Py_BEGIN_ALLOW_THREADS
23371  try {
23372  ((faiss::LinearTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4);
23373  } catch(faiss::FaissException & e) {
23374  PyEval_RestoreThread(_save);
23375 
23376  if (PyErr_Occurred()) {
23377  // some previous code already set the error type.
23378  } else {
23379  PyErr_SetString(PyExc_RuntimeError, e.what());
23380  }
23381  SWIG_fail;
23382  }
23383  Py_END_ALLOW_THREADS
23384  }
23385  resultobj = SWIG_Py_Void();
23386  return resultobj;
23387 fail:
23388  return NULL;
23389 }
23390 
23391 
23392 SWIGINTERN PyObject *_wrap_LinearTransform_set_is_orthonormal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23393  PyObject *resultobj = 0;
23395  void *argp1 = 0 ;
23396  int res1 = 0 ;
23397  PyObject * obj0 = 0 ;
23398 
23399  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_set_is_orthonormal",&obj0)) SWIG_fail;
23400  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23401  if (!SWIG_IsOK(res1)) {
23402  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_set_is_orthonormal" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
23403  }
23404  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23405  {
23406  Py_BEGIN_ALLOW_THREADS
23407  try {
23408  (arg1)->set_is_orthonormal();
23409  } catch(faiss::FaissException & e) {
23410  PyEval_RestoreThread(_save);
23411 
23412  if (PyErr_Occurred()) {
23413  // some previous code already set the error type.
23414  } else {
23415  PyErr_SetString(PyExc_RuntimeError, e.what());
23416  }
23417  SWIG_fail;
23418  }
23419  Py_END_ALLOW_THREADS
23420  }
23421  resultobj = SWIG_Py_Void();
23422  return resultobj;
23423 fail:
23424  return NULL;
23425 }
23426 
23427 
23428 SWIGINTERN PyObject *_wrap_LinearTransform_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23429  PyObject *resultobj = 0;
23431  bool arg2 ;
23432  void *argp1 = 0 ;
23433  int res1 = 0 ;
23434  bool val2 ;
23435  int ecode2 = 0 ;
23436  PyObject * obj0 = 0 ;
23437  PyObject * obj1 = 0 ;
23438 
23439  if (!PyArg_ParseTuple(args,(char *)"OO:LinearTransform_verbose_set",&obj0,&obj1)) SWIG_fail;
23440  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23441  if (!SWIG_IsOK(res1)) {
23442  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_set" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
23443  }
23444  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23445  ecode2 = SWIG_AsVal_bool(obj1, &val2);
23446  if (!SWIG_IsOK(ecode2)) {
23447  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "LinearTransform_verbose_set" "', argument " "2"" of type '" "bool""'");
23448  }
23449  arg2 = static_cast< bool >(val2);
23450  if (arg1) (arg1)->verbose = arg2;
23451  resultobj = SWIG_Py_Void();
23452  return resultobj;
23453 fail:
23454  return NULL;
23455 }
23456 
23457 
23458 SWIGINTERN PyObject *_wrap_LinearTransform_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23459  PyObject *resultobj = 0;
23461  void *argp1 = 0 ;
23462  int res1 = 0 ;
23463  PyObject * obj0 = 0 ;
23464  bool result;
23465 
23466  if (!PyArg_ParseTuple(args,(char *)"O:LinearTransform_verbose_get",&obj0)) SWIG_fail;
23467  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, 0 | 0 );
23468  if (!SWIG_IsOK(res1)) {
23469  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearTransform_verbose_get" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
23470  }
23471  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23472  result = (bool) ((arg1)->verbose);
23473  resultobj = SWIG_From_bool(static_cast< bool >(result));
23474  return resultobj;
23475 fail:
23476  return NULL;
23477 }
23478 
23479 
23480 SWIGINTERN PyObject *_wrap_delete_LinearTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23481  PyObject *resultobj = 0;
23483  void *argp1 = 0 ;
23484  int res1 = 0 ;
23485  PyObject * obj0 = 0 ;
23486 
23487  if (!PyArg_ParseTuple(args,(char *)"O:delete_LinearTransform",&obj0)) SWIG_fail;
23488  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__LinearTransform, SWIG_POINTER_DISOWN | 0 );
23489  if (!SWIG_IsOK(res1)) {
23490  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearTransform" "', argument " "1"" of type '" "faiss::LinearTransform *""'");
23491  }
23492  arg1 = reinterpret_cast< faiss::LinearTransform * >(argp1);
23493  {
23494  Py_BEGIN_ALLOW_THREADS
23495  try {
23496  delete arg1;
23497  } catch(faiss::FaissException & e) {
23498  PyEval_RestoreThread(_save);
23499 
23500  if (PyErr_Occurred()) {
23501  // some previous code already set the error type.
23502  } else {
23503  PyErr_SetString(PyExc_RuntimeError, e.what());
23504  }
23505  SWIG_fail;
23506  }
23507  Py_END_ALLOW_THREADS
23508  }
23509  resultobj = SWIG_Py_Void();
23510  return resultobj;
23511 fail:
23512  return NULL;
23513 }
23514 
23515 
23516 SWIGINTERN PyObject *LinearTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23517  PyObject *obj;
23518  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
23519  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__LinearTransform, SWIG_NewClientData(obj));
23520  return SWIG_Py_Void();
23521 }
23522 
23523 SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23524  PyObject *resultobj = 0;
23525  int arg1 ;
23526  int arg2 ;
23527  int val1 ;
23528  int ecode1 = 0 ;
23529  int val2 ;
23530  int ecode2 = 0 ;
23531  PyObject * obj0 = 0 ;
23532  PyObject * obj1 = 0 ;
23533  faiss::RandomRotationMatrix *result = 0 ;
23534 
23535  if (!PyArg_ParseTuple(args,(char *)"OO:new_RandomRotationMatrix",&obj0,&obj1)) SWIG_fail;
23536  ecode1 = SWIG_AsVal_int(obj0, &val1);
23537  if (!SWIG_IsOK(ecode1)) {
23538  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RandomRotationMatrix" "', argument " "1"" of type '" "int""'");
23539  }
23540  arg1 = static_cast< int >(val1);
23541  ecode2 = SWIG_AsVal_int(obj1, &val2);
23542  if (!SWIG_IsOK(ecode2)) {
23543  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RandomRotationMatrix" "', argument " "2"" of type '" "int""'");
23544  }
23545  arg2 = static_cast< int >(val2);
23546  {
23547  Py_BEGIN_ALLOW_THREADS
23548  try {
23549  result = (faiss::RandomRotationMatrix *)new faiss::RandomRotationMatrix(arg1,arg2);
23550  } catch(faiss::FaissException & e) {
23551  PyEval_RestoreThread(_save);
23552 
23553  if (PyErr_Occurred()) {
23554  // some previous code already set the error type.
23555  } else {
23556  PyErr_SetString(PyExc_RuntimeError, e.what());
23557  }
23558  SWIG_fail;
23559  }
23560  Py_END_ALLOW_THREADS
23561  }
23562  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 );
23563  return resultobj;
23564 fail:
23565  return NULL;
23566 }
23567 
23568 
23569 SWIGINTERN PyObject *_wrap_RandomRotationMatrix_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23570  PyObject *resultobj = 0;
23572  int arg2 ;
23573  void *argp1 = 0 ;
23574  int res1 = 0 ;
23575  int val2 ;
23576  int ecode2 = 0 ;
23577  PyObject * obj0 = 0 ;
23578  PyObject * obj1 = 0 ;
23579 
23580  if (!PyArg_ParseTuple(args,(char *)"OO:RandomRotationMatrix_init",&obj0,&obj1)) SWIG_fail;
23581  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 );
23582  if (!SWIG_IsOK(res1)) {
23583  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_init" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'");
23584  }
23585  arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1);
23586  ecode2 = SWIG_AsVal_int(obj1, &val2);
23587  if (!SWIG_IsOK(ecode2)) {
23588  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_init" "', argument " "2"" of type '" "int""'");
23589  }
23590  arg2 = static_cast< int >(val2);
23591  {
23592  Py_BEGIN_ALLOW_THREADS
23593  try {
23594  (arg1)->init(arg2);
23595  } catch(faiss::FaissException & e) {
23596  PyEval_RestoreThread(_save);
23597 
23598  if (PyErr_Occurred()) {
23599  // some previous code already set the error type.
23600  } else {
23601  PyErr_SetString(PyExc_RuntimeError, e.what());
23602  }
23603  SWIG_fail;
23604  }
23605  Py_END_ALLOW_THREADS
23606  }
23607  resultobj = SWIG_Py_Void();
23608  return resultobj;
23609 fail:
23610  return NULL;
23611 }
23612 
23613 
23614 SWIGINTERN PyObject *_wrap_RandomRotationMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23615  PyObject *resultobj = 0;
23617  faiss::Index::idx_t arg2 ;
23618  float *arg3 = (float *) 0 ;
23619  void *argp1 = 0 ;
23620  int res1 = 0 ;
23621  long val2 ;
23622  int ecode2 = 0 ;
23623  void *argp3 = 0 ;
23624  int res3 = 0 ;
23625  PyObject * obj0 = 0 ;
23626  PyObject * obj1 = 0 ;
23627  PyObject * obj2 = 0 ;
23628 
23629  if (!PyArg_ParseTuple(args,(char *)"OOO:RandomRotationMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail;
23630  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, 0 | 0 );
23631  if (!SWIG_IsOK(res1)) {
23632  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RandomRotationMatrix_train" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'");
23633  }
23634  arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1);
23635  ecode2 = SWIG_AsVal_long(obj1, &val2);
23636  if (!SWIG_IsOK(ecode2)) {
23637  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RandomRotationMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
23638  }
23639  arg2 = static_cast< faiss::Index::idx_t >(val2);
23640  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
23641  if (!SWIG_IsOK(res3)) {
23642  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RandomRotationMatrix_train" "', argument " "3"" of type '" "float const *""'");
23643  }
23644  arg3 = reinterpret_cast< float * >(argp3);
23645  {
23646  Py_BEGIN_ALLOW_THREADS
23647  try {
23648  (arg1)->train(arg2,(float const *)arg3);
23649  } catch(faiss::FaissException & e) {
23650  PyEval_RestoreThread(_save);
23651 
23652  if (PyErr_Occurred()) {
23653  // some previous code already set the error type.
23654  } else {
23655  PyErr_SetString(PyExc_RuntimeError, e.what());
23656  }
23657  SWIG_fail;
23658  }
23659  Py_END_ALLOW_THREADS
23660  }
23661  resultobj = SWIG_Py_Void();
23662  return resultobj;
23663 fail:
23664  return NULL;
23665 }
23666 
23667 
23668 SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23669  PyObject *resultobj = 0;
23670  faiss::RandomRotationMatrix *result = 0 ;
23671 
23672  if (!PyArg_ParseTuple(args,(char *)":new_RandomRotationMatrix")) SWIG_fail;
23673  {
23674  Py_BEGIN_ALLOW_THREADS
23675  try {
23677  } catch(faiss::FaissException & e) {
23678  PyEval_RestoreThread(_save);
23679 
23680  if (PyErr_Occurred()) {
23681  // some previous code already set the error type.
23682  } else {
23683  PyErr_SetString(PyExc_RuntimeError, e.what());
23684  }
23685  SWIG_fail;
23686  }
23687  Py_END_ALLOW_THREADS
23688  }
23689  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_NEW | 0 );
23690  return resultobj;
23691 fail:
23692  return NULL;
23693 }
23694 
23695 
23696 SWIGINTERN PyObject *_wrap_new_RandomRotationMatrix(PyObject *self, PyObject *args) {
23697  Py_ssize_t argc;
23698  PyObject *argv[3] = {
23699  0
23700  };
23701  Py_ssize_t ii;
23702 
23703  if (!PyTuple_Check(args)) SWIG_fail;
23704  argc = args ? PyObject_Length(args) : 0;
23705  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
23706  argv[ii] = PyTuple_GET_ITEM(args,ii);
23707  }
23708  if (argc == 0) {
23709  return _wrap_new_RandomRotationMatrix__SWIG_1(self, args);
23710  }
23711  if (argc == 2) {
23712  int _v;
23713  {
23714  int res = SWIG_AsVal_int(argv[0], NULL);
23715  _v = SWIG_CheckState(res);
23716  }
23717  if (_v) {
23718  {
23719  int res = SWIG_AsVal_int(argv[1], NULL);
23720  _v = SWIG_CheckState(res);
23721  }
23722  if (_v) {
23723  return _wrap_new_RandomRotationMatrix__SWIG_0(self, args);
23724  }
23725  }
23726  }
23727 
23728 fail:
23729  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RandomRotationMatrix'.\n"
23730  " Possible C/C++ prototypes are:\n"
23731  " faiss::RandomRotationMatrix::RandomRotationMatrix(int,int)\n"
23732  " faiss::RandomRotationMatrix::RandomRotationMatrix()\n");
23733  return 0;
23734 }
23735 
23736 
23737 SWIGINTERN PyObject *_wrap_delete_RandomRotationMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23738  PyObject *resultobj = 0;
23740  void *argp1 = 0 ;
23741  int res1 = 0 ;
23742  PyObject * obj0 = 0 ;
23743 
23744  if (!PyArg_ParseTuple(args,(char *)"O:delete_RandomRotationMatrix",&obj0)) SWIG_fail;
23745  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_POINTER_DISOWN | 0 );
23746  if (!SWIG_IsOK(res1)) {
23747  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RandomRotationMatrix" "', argument " "1"" of type '" "faiss::RandomRotationMatrix *""'");
23748  }
23749  arg1 = reinterpret_cast< faiss::RandomRotationMatrix * >(argp1);
23750  delete arg1;
23751  resultobj = SWIG_Py_Void();
23752  return resultobj;
23753 fail:
23754  return NULL;
23755 }
23756 
23757 
23758 SWIGINTERN PyObject *RandomRotationMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23759  PyObject *obj;
23760  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
23761  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RandomRotationMatrix, SWIG_NewClientData(obj));
23762  return SWIG_Py_Void();
23763 }
23764 
23765 SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23766  PyObject *resultobj = 0;
23767  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23768  float arg2 ;
23769  void *argp1 = 0 ;
23770  int res1 = 0 ;
23771  float val2 ;
23772  int ecode2 = 0 ;
23773  PyObject * obj0 = 0 ;
23774  PyObject * obj1 = 0 ;
23775 
23776  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigen_power_set",&obj0,&obj1)) SWIG_fail;
23777  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23778  if (!SWIG_IsOK(res1)) {
23779  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23780  }
23781  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23782  ecode2 = SWIG_AsVal_float(obj1, &val2);
23783  if (!SWIG_IsOK(ecode2)) {
23784  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_eigen_power_set" "', argument " "2"" of type '" "float""'");
23785  }
23786  arg2 = static_cast< float >(val2);
23787  if (arg1) (arg1)->eigen_power = arg2;
23788  resultobj = SWIG_Py_Void();
23789  return resultobj;
23790 fail:
23791  return NULL;
23792 }
23793 
23794 
23795 SWIGINTERN PyObject *_wrap_PCAMatrix_eigen_power_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23796  PyObject *resultobj = 0;
23797  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23798  void *argp1 = 0 ;
23799  int res1 = 0 ;
23800  PyObject * obj0 = 0 ;
23801  float result;
23802 
23803  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigen_power_get",&obj0)) SWIG_fail;
23804  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23805  if (!SWIG_IsOK(res1)) {
23806  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigen_power_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23807  }
23808  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23809  result = (float) ((arg1)->eigen_power);
23810  resultobj = SWIG_From_float(static_cast< float >(result));
23811  return resultobj;
23812 fail:
23813  return NULL;
23814 }
23815 
23816 
23817 SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23818  PyObject *resultobj = 0;
23819  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23820  bool arg2 ;
23821  void *argp1 = 0 ;
23822  int res1 = 0 ;
23823  bool val2 ;
23824  int ecode2 = 0 ;
23825  PyObject * obj0 = 0 ;
23826  PyObject * obj1 = 0 ;
23827 
23828  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_random_rotation_set",&obj0,&obj1)) SWIG_fail;
23829  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23830  if (!SWIG_IsOK(res1)) {
23831  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23832  }
23833  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23834  ecode2 = SWIG_AsVal_bool(obj1, &val2);
23835  if (!SWIG_IsOK(ecode2)) {
23836  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_random_rotation_set" "', argument " "2"" of type '" "bool""'");
23837  }
23838  arg2 = static_cast< bool >(val2);
23839  if (arg1) (arg1)->random_rotation = arg2;
23840  resultobj = SWIG_Py_Void();
23841  return resultobj;
23842 fail:
23843  return NULL;
23844 }
23845 
23846 
23847 SWIGINTERN PyObject *_wrap_PCAMatrix_random_rotation_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23848  PyObject *resultobj = 0;
23849  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23850  void *argp1 = 0 ;
23851  int res1 = 0 ;
23852  PyObject * obj0 = 0 ;
23853  bool result;
23854 
23855  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_random_rotation_get",&obj0)) SWIG_fail;
23856  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23857  if (!SWIG_IsOK(res1)) {
23858  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_random_rotation_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23859  }
23860  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23861  result = (bool) ((arg1)->random_rotation);
23862  resultobj = SWIG_From_bool(static_cast< bool >(result));
23863  return resultobj;
23864 fail:
23865  return NULL;
23866 }
23867 
23868 
23869 SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23870  PyObject *resultobj = 0;
23871  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23872  size_t arg2 ;
23873  void *argp1 = 0 ;
23874  int res1 = 0 ;
23875  size_t val2 ;
23876  int ecode2 = 0 ;
23877  PyObject * obj0 = 0 ;
23878  PyObject * obj1 = 0 ;
23879 
23880  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_max_points_per_d_set",&obj0,&obj1)) SWIG_fail;
23881  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23882  if (!SWIG_IsOK(res1)) {
23883  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23884  }
23885  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23886  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
23887  if (!SWIG_IsOK(ecode2)) {
23888  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_max_points_per_d_set" "', argument " "2"" of type '" "size_t""'");
23889  }
23890  arg2 = static_cast< size_t >(val2);
23891  if (arg1) (arg1)->max_points_per_d = arg2;
23892  resultobj = SWIG_Py_Void();
23893  return resultobj;
23894 fail:
23895  return NULL;
23896 }
23897 
23898 
23899 SWIGINTERN PyObject *_wrap_PCAMatrix_max_points_per_d_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23900  PyObject *resultobj = 0;
23901  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23902  void *argp1 = 0 ;
23903  int res1 = 0 ;
23904  PyObject * obj0 = 0 ;
23905  size_t result;
23906 
23907  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_max_points_per_d_get",&obj0)) SWIG_fail;
23908  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23909  if (!SWIG_IsOK(res1)) {
23910  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_max_points_per_d_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23911  }
23912  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23913  result = (size_t) ((arg1)->max_points_per_d);
23914  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
23915  return resultobj;
23916 fail:
23917  return NULL;
23918 }
23919 
23920 
23921 SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23922  PyObject *resultobj = 0;
23923  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23924  int arg2 ;
23925  void *argp1 = 0 ;
23926  int res1 = 0 ;
23927  int val2 ;
23928  int ecode2 = 0 ;
23929  PyObject * obj0 = 0 ;
23930  PyObject * obj1 = 0 ;
23931 
23932  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_balanced_bins_set",&obj0,&obj1)) SWIG_fail;
23933  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23934  if (!SWIG_IsOK(res1)) {
23935  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23936  }
23937  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23938  ecode2 = SWIG_AsVal_int(obj1, &val2);
23939  if (!SWIG_IsOK(ecode2)) {
23940  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_balanced_bins_set" "', argument " "2"" of type '" "int""'");
23941  }
23942  arg2 = static_cast< int >(val2);
23943  if (arg1) (arg1)->balanced_bins = arg2;
23944  resultobj = SWIG_Py_Void();
23945  return resultobj;
23946 fail:
23947  return NULL;
23948 }
23949 
23950 
23951 SWIGINTERN PyObject *_wrap_PCAMatrix_balanced_bins_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23952  PyObject *resultobj = 0;
23953  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23954  void *argp1 = 0 ;
23955  int res1 = 0 ;
23956  PyObject * obj0 = 0 ;
23957  int result;
23958 
23959  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_balanced_bins_get",&obj0)) SWIG_fail;
23960  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23961  if (!SWIG_IsOK(res1)) {
23962  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_balanced_bins_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23963  }
23964  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23965  result = (int) ((arg1)->balanced_bins);
23966  resultobj = SWIG_From_int(static_cast< int >(result));
23967  return resultobj;
23968 fail:
23969  return NULL;
23970 }
23971 
23972 
23973 SWIGINTERN PyObject *_wrap_PCAMatrix_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23974  PyObject *resultobj = 0;
23975  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
23976  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
23977  void *argp1 = 0 ;
23978  int res1 = 0 ;
23979  void *argp2 = 0 ;
23980  int res2 = 0 ;
23981  PyObject * obj0 = 0 ;
23982  PyObject * obj1 = 0 ;
23983 
23984  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_mean_set",&obj0,&obj1)) SWIG_fail;
23985  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
23986  if (!SWIG_IsOK(res1)) {
23987  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
23988  }
23989  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
23990  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
23991  if (!SWIG_IsOK(res2)) {
23992  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'");
23993  }
23994  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
23995  if (arg1) (arg1)->mean = *arg2;
23996  resultobj = SWIG_Py_Void();
23997  return resultobj;
23998 fail:
23999  return NULL;
24000 }
24001 
24002 
24003 SWIGINTERN PyObject *_wrap_PCAMatrix_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24004  PyObject *resultobj = 0;
24005  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24006  void *argp1 = 0 ;
24007  int res1 = 0 ;
24008  PyObject * obj0 = 0 ;
24009  std::vector< float > *result = 0 ;
24010 
24011  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_mean_get",&obj0)) SWIG_fail;
24012  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24013  if (!SWIG_IsOK(res1)) {
24014  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_mean_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24015  }
24016  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24017  result = (std::vector< float > *)& ((arg1)->mean);
24018  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
24019  return resultobj;
24020 fail:
24021  return NULL;
24022 }
24023 
24024 
24025 SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24026  PyObject *resultobj = 0;
24027  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24028  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
24029  void *argp1 = 0 ;
24030  int res1 = 0 ;
24031  void *argp2 = 0 ;
24032  int res2 = 0 ;
24033  PyObject * obj0 = 0 ;
24034  PyObject * obj1 = 0 ;
24035 
24036  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_eigenvalues_set",&obj0,&obj1)) SWIG_fail;
24037  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24038  if (!SWIG_IsOK(res1)) {
24039  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24040  }
24041  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24042  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
24043  if (!SWIG_IsOK(res2)) {
24044  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_eigenvalues_set" "', argument " "2"" of type '" "std::vector< float > *""'");
24045  }
24046  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
24047  if (arg1) (arg1)->eigenvalues = *arg2;
24048  resultobj = SWIG_Py_Void();
24049  return resultobj;
24050 fail:
24051  return NULL;
24052 }
24053 
24054 
24055 SWIGINTERN PyObject *_wrap_PCAMatrix_eigenvalues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24056  PyObject *resultobj = 0;
24057  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24058  void *argp1 = 0 ;
24059  int res1 = 0 ;
24060  PyObject * obj0 = 0 ;
24061  std::vector< float > *result = 0 ;
24062 
24063  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_eigenvalues_get",&obj0)) SWIG_fail;
24064  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24065  if (!SWIG_IsOK(res1)) {
24066  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_eigenvalues_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24067  }
24068  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24069  result = (std::vector< float > *)& ((arg1)->eigenvalues);
24070  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
24071  return resultobj;
24072 fail:
24073  return NULL;
24074 }
24075 
24076 
24077 SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24078  PyObject *resultobj = 0;
24079  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24080  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
24081  void *argp1 = 0 ;
24082  int res1 = 0 ;
24083  void *argp2 = 0 ;
24084  int res2 = 0 ;
24085  PyObject * obj0 = 0 ;
24086  PyObject * obj1 = 0 ;
24087 
24088  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_PCAMat_set",&obj0,&obj1)) SWIG_fail;
24089  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24090  if (!SWIG_IsOK(res1)) {
24091  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_set" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24092  }
24093  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24094  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
24095  if (!SWIG_IsOK(res2)) {
24096  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_PCAMat_set" "', argument " "2"" of type '" "std::vector< float > *""'");
24097  }
24098  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
24099  if (arg1) (arg1)->PCAMat = *arg2;
24100  resultobj = SWIG_Py_Void();
24101  return resultobj;
24102 fail:
24103  return NULL;
24104 }
24105 
24106 
24107 SWIGINTERN PyObject *_wrap_PCAMatrix_PCAMat_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24108  PyObject *resultobj = 0;
24109  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24110  void *argp1 = 0 ;
24111  int res1 = 0 ;
24112  PyObject * obj0 = 0 ;
24113  std::vector< float > *result = 0 ;
24114 
24115  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_PCAMat_get",&obj0)) SWIG_fail;
24116  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24117  if (!SWIG_IsOK(res1)) {
24118  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_PCAMat_get" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24119  }
24120  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24121  result = (std::vector< float > *)& ((arg1)->PCAMat);
24122  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
24123  return resultobj;
24124 fail:
24125  return NULL;
24126 }
24127 
24128 
24129 SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24130  PyObject *resultobj = 0;
24131  int arg1 ;
24132  int arg2 ;
24133  float arg3 ;
24134  bool arg4 ;
24135  int val1 ;
24136  int ecode1 = 0 ;
24137  int val2 ;
24138  int ecode2 = 0 ;
24139  float val3 ;
24140  int ecode3 = 0 ;
24141  bool val4 ;
24142  int ecode4 = 0 ;
24143  PyObject * obj0 = 0 ;
24144  PyObject * obj1 = 0 ;
24145  PyObject * obj2 = 0 ;
24146  PyObject * obj3 = 0 ;
24147  faiss::PCAMatrix *result = 0 ;
24148 
24149  if (!PyArg_ParseTuple(args,(char *)"OOOO:new_PCAMatrix",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
24150  ecode1 = SWIG_AsVal_int(obj0, &val1);
24151  if (!SWIG_IsOK(ecode1)) {
24152  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'");
24153  }
24154  arg1 = static_cast< int >(val1);
24155  ecode2 = SWIG_AsVal_int(obj1, &val2);
24156  if (!SWIG_IsOK(ecode2)) {
24157  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'");
24158  }
24159  arg2 = static_cast< int >(val2);
24160  ecode3 = SWIG_AsVal_float(obj2, &val3);
24161  if (!SWIG_IsOK(ecode3)) {
24162  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'");
24163  }
24164  arg3 = static_cast< float >(val3);
24165  ecode4 = SWIG_AsVal_bool(obj3, &val4);
24166  if (!SWIG_IsOK(ecode4)) {
24167  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_PCAMatrix" "', argument " "4"" of type '" "bool""'");
24168  }
24169  arg4 = static_cast< bool >(val4);
24170  {
24171  Py_BEGIN_ALLOW_THREADS
24172  try {
24173  result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3,arg4);
24174  } catch(faiss::FaissException & e) {
24175  PyEval_RestoreThread(_save);
24176 
24177  if (PyErr_Occurred()) {
24178  // some previous code already set the error type.
24179  } else {
24180  PyErr_SetString(PyExc_RuntimeError, e.what());
24181  }
24182  SWIG_fail;
24183  }
24184  Py_END_ALLOW_THREADS
24185  }
24186  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 );
24187  return resultobj;
24188 fail:
24189  return NULL;
24190 }
24191 
24192 
24193 SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24194  PyObject *resultobj = 0;
24195  int arg1 ;
24196  int arg2 ;
24197  float arg3 ;
24198  int val1 ;
24199  int ecode1 = 0 ;
24200  int val2 ;
24201  int ecode2 = 0 ;
24202  float val3 ;
24203  int ecode3 = 0 ;
24204  PyObject * obj0 = 0 ;
24205  PyObject * obj1 = 0 ;
24206  PyObject * obj2 = 0 ;
24207  faiss::PCAMatrix *result = 0 ;
24208 
24209  if (!PyArg_ParseTuple(args,(char *)"OOO:new_PCAMatrix",&obj0,&obj1,&obj2)) SWIG_fail;
24210  ecode1 = SWIG_AsVal_int(obj0, &val1);
24211  if (!SWIG_IsOK(ecode1)) {
24212  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'");
24213  }
24214  arg1 = static_cast< int >(val1);
24215  ecode2 = SWIG_AsVal_int(obj1, &val2);
24216  if (!SWIG_IsOK(ecode2)) {
24217  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'");
24218  }
24219  arg2 = static_cast< int >(val2);
24220  ecode3 = SWIG_AsVal_float(obj2, &val3);
24221  if (!SWIG_IsOK(ecode3)) {
24222  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_PCAMatrix" "', argument " "3"" of type '" "float""'");
24223  }
24224  arg3 = static_cast< float >(val3);
24225  {
24226  Py_BEGIN_ALLOW_THREADS
24227  try {
24228  result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2,arg3);
24229  } catch(faiss::FaissException & e) {
24230  PyEval_RestoreThread(_save);
24231 
24232  if (PyErr_Occurred()) {
24233  // some previous code already set the error type.
24234  } else {
24235  PyErr_SetString(PyExc_RuntimeError, e.what());
24236  }
24237  SWIG_fail;
24238  }
24239  Py_END_ALLOW_THREADS
24240  }
24241  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 );
24242  return resultobj;
24243 fail:
24244  return NULL;
24245 }
24246 
24247 
24248 SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24249  PyObject *resultobj = 0;
24250  int arg1 ;
24251  int arg2 ;
24252  int val1 ;
24253  int ecode1 = 0 ;
24254  int val2 ;
24255  int ecode2 = 0 ;
24256  PyObject * obj0 = 0 ;
24257  PyObject * obj1 = 0 ;
24258  faiss::PCAMatrix *result = 0 ;
24259 
24260  if (!PyArg_ParseTuple(args,(char *)"OO:new_PCAMatrix",&obj0,&obj1)) SWIG_fail;
24261  ecode1 = SWIG_AsVal_int(obj0, &val1);
24262  if (!SWIG_IsOK(ecode1)) {
24263  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'");
24264  }
24265  arg1 = static_cast< int >(val1);
24266  ecode2 = SWIG_AsVal_int(obj1, &val2);
24267  if (!SWIG_IsOK(ecode2)) {
24268  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_PCAMatrix" "', argument " "2"" of type '" "int""'");
24269  }
24270  arg2 = static_cast< int >(val2);
24271  {
24272  Py_BEGIN_ALLOW_THREADS
24273  try {
24274  result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1,arg2);
24275  } catch(faiss::FaissException & e) {
24276  PyEval_RestoreThread(_save);
24277 
24278  if (PyErr_Occurred()) {
24279  // some previous code already set the error type.
24280  } else {
24281  PyErr_SetString(PyExc_RuntimeError, e.what());
24282  }
24283  SWIG_fail;
24284  }
24285  Py_END_ALLOW_THREADS
24286  }
24287  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 );
24288  return resultobj;
24289 fail:
24290  return NULL;
24291 }
24292 
24293 
24294 SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24295  PyObject *resultobj = 0;
24296  int arg1 ;
24297  int val1 ;
24298  int ecode1 = 0 ;
24299  PyObject * obj0 = 0 ;
24300  faiss::PCAMatrix *result = 0 ;
24301 
24302  if (!PyArg_ParseTuple(args,(char *)"O:new_PCAMatrix",&obj0)) SWIG_fail;
24303  ecode1 = SWIG_AsVal_int(obj0, &val1);
24304  if (!SWIG_IsOK(ecode1)) {
24305  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_PCAMatrix" "', argument " "1"" of type '" "int""'");
24306  }
24307  arg1 = static_cast< int >(val1);
24308  {
24309  Py_BEGIN_ALLOW_THREADS
24310  try {
24311  result = (faiss::PCAMatrix *)new faiss::PCAMatrix(arg1);
24312  } catch(faiss::FaissException & e) {
24313  PyEval_RestoreThread(_save);
24314 
24315  if (PyErr_Occurred()) {
24316  // some previous code already set the error type.
24317  } else {
24318  PyErr_SetString(PyExc_RuntimeError, e.what());
24319  }
24320  SWIG_fail;
24321  }
24322  Py_END_ALLOW_THREADS
24323  }
24324  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 );
24325  return resultobj;
24326 fail:
24327  return NULL;
24328 }
24329 
24330 
24331 SWIGINTERN PyObject *_wrap_new_PCAMatrix__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24332  PyObject *resultobj = 0;
24333  faiss::PCAMatrix *result = 0 ;
24334 
24335  if (!PyArg_ParseTuple(args,(char *)":new_PCAMatrix")) SWIG_fail;
24336  {
24337  Py_BEGIN_ALLOW_THREADS
24338  try {
24339  result = (faiss::PCAMatrix *)new faiss::PCAMatrix();
24340  } catch(faiss::FaissException & e) {
24341  PyEval_RestoreThread(_save);
24342 
24343  if (PyErr_Occurred()) {
24344  // some previous code already set the error type.
24345  } else {
24346  PyErr_SetString(PyExc_RuntimeError, e.what());
24347  }
24348  SWIG_fail;
24349  }
24350  Py_END_ALLOW_THREADS
24351  }
24352  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_NEW | 0 );
24353  return resultobj;
24354 fail:
24355  return NULL;
24356 }
24357 
24358 
24359 SWIGINTERN PyObject *_wrap_new_PCAMatrix(PyObject *self, PyObject *args) {
24360  Py_ssize_t argc;
24361  PyObject *argv[5] = {
24362  0
24363  };
24364  Py_ssize_t ii;
24365 
24366  if (!PyTuple_Check(args)) SWIG_fail;
24367  argc = args ? PyObject_Length(args) : 0;
24368  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
24369  argv[ii] = PyTuple_GET_ITEM(args,ii);
24370  }
24371  if (argc == 0) {
24372  return _wrap_new_PCAMatrix__SWIG_4(self, args);
24373  }
24374  if (argc == 1) {
24375  int _v;
24376  {
24377  int res = SWIG_AsVal_int(argv[0], NULL);
24378  _v = SWIG_CheckState(res);
24379  }
24380  if (_v) {
24381  return _wrap_new_PCAMatrix__SWIG_3(self, args);
24382  }
24383  }
24384  if (argc == 2) {
24385  int _v;
24386  {
24387  int res = SWIG_AsVal_int(argv[0], NULL);
24388  _v = SWIG_CheckState(res);
24389  }
24390  if (_v) {
24391  {
24392  int res = SWIG_AsVal_int(argv[1], NULL);
24393  _v = SWIG_CheckState(res);
24394  }
24395  if (_v) {
24396  return _wrap_new_PCAMatrix__SWIG_2(self, args);
24397  }
24398  }
24399  }
24400  if (argc == 3) {
24401  int _v;
24402  {
24403  int res = SWIG_AsVal_int(argv[0], NULL);
24404  _v = SWIG_CheckState(res);
24405  }
24406  if (_v) {
24407  {
24408  int res = SWIG_AsVal_int(argv[1], NULL);
24409  _v = SWIG_CheckState(res);
24410  }
24411  if (_v) {
24412  {
24413  int res = SWIG_AsVal_float(argv[2], NULL);
24414  _v = SWIG_CheckState(res);
24415  }
24416  if (_v) {
24417  return _wrap_new_PCAMatrix__SWIG_1(self, args);
24418  }
24419  }
24420  }
24421  }
24422  if (argc == 4) {
24423  int _v;
24424  {
24425  int res = SWIG_AsVal_int(argv[0], NULL);
24426  _v = SWIG_CheckState(res);
24427  }
24428  if (_v) {
24429  {
24430  int res = SWIG_AsVal_int(argv[1], NULL);
24431  _v = SWIG_CheckState(res);
24432  }
24433  if (_v) {
24434  {
24435  int res = SWIG_AsVal_float(argv[2], NULL);
24436  _v = SWIG_CheckState(res);
24437  }
24438  if (_v) {
24439  {
24440  int res = SWIG_AsVal_bool(argv[3], NULL);
24441  _v = SWIG_CheckState(res);
24442  }
24443  if (_v) {
24444  return _wrap_new_PCAMatrix__SWIG_0(self, args);
24445  }
24446  }
24447  }
24448  }
24449  }
24450 
24451 fail:
24452  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_PCAMatrix'.\n"
24453  " Possible C/C++ prototypes are:\n"
24454  " faiss::PCAMatrix::PCAMatrix(int,int,float,bool)\n"
24455  " faiss::PCAMatrix::PCAMatrix(int,int,float)\n"
24456  " faiss::PCAMatrix::PCAMatrix(int,int)\n"
24457  " faiss::PCAMatrix::PCAMatrix(int)\n"
24458  " faiss::PCAMatrix::PCAMatrix()\n");
24459  return 0;
24460 }
24461 
24462 
24463 SWIGINTERN PyObject *_wrap_PCAMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24464  PyObject *resultobj = 0;
24465  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24466  faiss::Index::idx_t arg2 ;
24467  float *arg3 = (float *) 0 ;
24468  void *argp1 = 0 ;
24469  int res1 = 0 ;
24470  long val2 ;
24471  int ecode2 = 0 ;
24472  void *argp3 = 0 ;
24473  int res3 = 0 ;
24474  PyObject * obj0 = 0 ;
24475  PyObject * obj1 = 0 ;
24476  PyObject * obj2 = 0 ;
24477 
24478  if (!PyArg_ParseTuple(args,(char *)"OOO:PCAMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail;
24479  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24480  if (!SWIG_IsOK(res1)) {
24481  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_train" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24482  }
24483  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24484  ecode2 = SWIG_AsVal_long(obj1, &val2);
24485  if (!SWIG_IsOK(ecode2)) {
24486  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PCAMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
24487  }
24488  arg2 = static_cast< faiss::Index::idx_t >(val2);
24489  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
24490  if (!SWIG_IsOK(res3)) {
24491  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "PCAMatrix_train" "', argument " "3"" of type '" "float const *""'");
24492  }
24493  arg3 = reinterpret_cast< float * >(argp3);
24494  {
24495  Py_BEGIN_ALLOW_THREADS
24496  try {
24497  (arg1)->train(arg2,(float const *)arg3);
24498  } catch(faiss::FaissException & e) {
24499  PyEval_RestoreThread(_save);
24500 
24501  if (PyErr_Occurred()) {
24502  // some previous code already set the error type.
24503  } else {
24504  PyErr_SetString(PyExc_RuntimeError, e.what());
24505  }
24506  SWIG_fail;
24507  }
24508  Py_END_ALLOW_THREADS
24509  }
24510  resultobj = SWIG_Py_Void();
24511  return resultobj;
24512 fail:
24513  return NULL;
24514 }
24515 
24516 
24517 SWIGINTERN PyObject *_wrap_PCAMatrix_copy_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24518  PyObject *resultobj = 0;
24519  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24520  faiss::PCAMatrix *arg2 = 0 ;
24521  void *argp1 = 0 ;
24522  int res1 = 0 ;
24523  void *argp2 = 0 ;
24524  int res2 = 0 ;
24525  PyObject * obj0 = 0 ;
24526  PyObject * obj1 = 0 ;
24527 
24528  if (!PyArg_ParseTuple(args,(char *)"OO:PCAMatrix_copy_from",&obj0,&obj1)) SWIG_fail;
24529  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24530  if (!SWIG_IsOK(res1)) {
24531  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_copy_from" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24532  }
24533  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24534  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__PCAMatrix, 0 | 0);
24535  if (!SWIG_IsOK(res2)) {
24536  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'");
24537  }
24538  if (!argp2) {
24539  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PCAMatrix_copy_from" "', argument " "2"" of type '" "faiss::PCAMatrix const &""'");
24540  }
24541  arg2 = reinterpret_cast< faiss::PCAMatrix * >(argp2);
24542  {
24543  Py_BEGIN_ALLOW_THREADS
24544  try {
24545  (arg1)->copy_from((faiss::PCAMatrix const &)*arg2);
24546  } catch(faiss::FaissException & e) {
24547  PyEval_RestoreThread(_save);
24548 
24549  if (PyErr_Occurred()) {
24550  // some previous code already set the error type.
24551  } else {
24552  PyErr_SetString(PyExc_RuntimeError, e.what());
24553  }
24554  SWIG_fail;
24555  }
24556  Py_END_ALLOW_THREADS
24557  }
24558  resultobj = SWIG_Py_Void();
24559  return resultobj;
24560 fail:
24561  return NULL;
24562 }
24563 
24564 
24565 SWIGINTERN PyObject *_wrap_PCAMatrix_prepare_Ab(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24566  PyObject *resultobj = 0;
24567  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24568  void *argp1 = 0 ;
24569  int res1 = 0 ;
24570  PyObject * obj0 = 0 ;
24571 
24572  if (!PyArg_ParseTuple(args,(char *)"O:PCAMatrix_prepare_Ab",&obj0)) SWIG_fail;
24573  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, 0 | 0 );
24574  if (!SWIG_IsOK(res1)) {
24575  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PCAMatrix_prepare_Ab" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24576  }
24577  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24578  {
24579  Py_BEGIN_ALLOW_THREADS
24580  try {
24581  (arg1)->prepare_Ab();
24582  } catch(faiss::FaissException & e) {
24583  PyEval_RestoreThread(_save);
24584 
24585  if (PyErr_Occurred()) {
24586  // some previous code already set the error type.
24587  } else {
24588  PyErr_SetString(PyExc_RuntimeError, e.what());
24589  }
24590  SWIG_fail;
24591  }
24592  Py_END_ALLOW_THREADS
24593  }
24594  resultobj = SWIG_Py_Void();
24595  return resultobj;
24596 fail:
24597  return NULL;
24598 }
24599 
24600 
24601 SWIGINTERN PyObject *_wrap_delete_PCAMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24602  PyObject *resultobj = 0;
24603  faiss::PCAMatrix *arg1 = (faiss::PCAMatrix *) 0 ;
24604  void *argp1 = 0 ;
24605  int res1 = 0 ;
24606  PyObject * obj0 = 0 ;
24607 
24608  if (!PyArg_ParseTuple(args,(char *)"O:delete_PCAMatrix",&obj0)) SWIG_fail;
24609  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__PCAMatrix, SWIG_POINTER_DISOWN | 0 );
24610  if (!SWIG_IsOK(res1)) {
24611  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PCAMatrix" "', argument " "1"" of type '" "faiss::PCAMatrix *""'");
24612  }
24613  arg1 = reinterpret_cast< faiss::PCAMatrix * >(argp1);
24614  delete arg1;
24615  resultobj = SWIG_Py_Void();
24616  return resultobj;
24617 fail:
24618  return NULL;
24619 }
24620 
24621 
24622 SWIGINTERN PyObject *PCAMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24623  PyObject *obj;
24624  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
24625  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__PCAMatrix, SWIG_NewClientData(obj));
24626  return SWIG_Py_Void();
24627 }
24628 
24629 SWIGINTERN PyObject *_wrap_OPQMatrix_M_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24630  PyObject *resultobj = 0;
24631  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24632  int arg2 ;
24633  void *argp1 = 0 ;
24634  int res1 = 0 ;
24635  int val2 ;
24636  int ecode2 = 0 ;
24637  PyObject * obj0 = 0 ;
24638  PyObject * obj1 = 0 ;
24639 
24640  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_M_set",&obj0,&obj1)) SWIG_fail;
24641  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24642  if (!SWIG_IsOK(res1)) {
24643  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24644  }
24645  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24646  ecode2 = SWIG_AsVal_int(obj1, &val2);
24647  if (!SWIG_IsOK(ecode2)) {
24648  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_M_set" "', argument " "2"" of type '" "int""'");
24649  }
24650  arg2 = static_cast< int >(val2);
24651  if (arg1) (arg1)->M = arg2;
24652  resultobj = SWIG_Py_Void();
24653  return resultobj;
24654 fail:
24655  return NULL;
24656 }
24657 
24658 
24659 SWIGINTERN PyObject *_wrap_OPQMatrix_M_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24660  PyObject *resultobj = 0;
24661  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24662  void *argp1 = 0 ;
24663  int res1 = 0 ;
24664  PyObject * obj0 = 0 ;
24665  int result;
24666 
24667  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_M_get",&obj0)) SWIG_fail;
24668  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24669  if (!SWIG_IsOK(res1)) {
24670  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_M_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24671  }
24672  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24673  result = (int) ((arg1)->M);
24674  resultobj = SWIG_From_int(static_cast< int >(result));
24675  return resultobj;
24676 fail:
24677  return NULL;
24678 }
24679 
24680 
24681 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24682  PyObject *resultobj = 0;
24683  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24684  int arg2 ;
24685  void *argp1 = 0 ;
24686  int res1 = 0 ;
24687  int val2 ;
24688  int ecode2 = 0 ;
24689  PyObject * obj0 = 0 ;
24690  PyObject * obj1 = 0 ;
24691 
24692  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_set",&obj0,&obj1)) SWIG_fail;
24693  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24694  if (!SWIG_IsOK(res1)) {
24695  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24696  }
24697  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24698  ecode2 = SWIG_AsVal_int(obj1, &val2);
24699  if (!SWIG_IsOK(ecode2)) {
24700  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_set" "', argument " "2"" of type '" "int""'");
24701  }
24702  arg2 = static_cast< int >(val2);
24703  if (arg1) (arg1)->niter = arg2;
24704  resultobj = SWIG_Py_Void();
24705  return resultobj;
24706 fail:
24707  return NULL;
24708 }
24709 
24710 
24711 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24712  PyObject *resultobj = 0;
24713  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24714  void *argp1 = 0 ;
24715  int res1 = 0 ;
24716  PyObject * obj0 = 0 ;
24717  int result;
24718 
24719  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_get",&obj0)) SWIG_fail;
24720  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24721  if (!SWIG_IsOK(res1)) {
24722  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24723  }
24724  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24725  result = (int) ((arg1)->niter);
24726  resultobj = SWIG_From_int(static_cast< int >(result));
24727  return resultobj;
24728 fail:
24729  return NULL;
24730 }
24731 
24732 
24733 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24734  PyObject *resultobj = 0;
24735  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24736  int arg2 ;
24737  void *argp1 = 0 ;
24738  int res1 = 0 ;
24739  int val2 ;
24740  int ecode2 = 0 ;
24741  PyObject * obj0 = 0 ;
24742  PyObject * obj1 = 0 ;
24743 
24744  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_set",&obj0,&obj1)) SWIG_fail;
24745  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24746  if (!SWIG_IsOK(res1)) {
24747  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24748  }
24749  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24750  ecode2 = SWIG_AsVal_int(obj1, &val2);
24751  if (!SWIG_IsOK(ecode2)) {
24752  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_set" "', argument " "2"" of type '" "int""'");
24753  }
24754  arg2 = static_cast< int >(val2);
24755  if (arg1) (arg1)->niter_pq = arg2;
24756  resultobj = SWIG_Py_Void();
24757  return resultobj;
24758 fail:
24759  return NULL;
24760 }
24761 
24762 
24763 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24764  PyObject *resultobj = 0;
24765  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24766  void *argp1 = 0 ;
24767  int res1 = 0 ;
24768  PyObject * obj0 = 0 ;
24769  int result;
24770 
24771  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_get",&obj0)) SWIG_fail;
24772  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24773  if (!SWIG_IsOK(res1)) {
24774  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24775  }
24776  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24777  result = (int) ((arg1)->niter_pq);
24778  resultobj = SWIG_From_int(static_cast< int >(result));
24779  return resultobj;
24780 fail:
24781  return NULL;
24782 }
24783 
24784 
24785 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24786  PyObject *resultobj = 0;
24787  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24788  int arg2 ;
24789  void *argp1 = 0 ;
24790  int res1 = 0 ;
24791  int val2 ;
24792  int ecode2 = 0 ;
24793  PyObject * obj0 = 0 ;
24794  PyObject * obj1 = 0 ;
24795 
24796  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_niter_pq_0_set",&obj0,&obj1)) SWIG_fail;
24797  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24798  if (!SWIG_IsOK(res1)) {
24799  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24800  }
24801  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24802  ecode2 = SWIG_AsVal_int(obj1, &val2);
24803  if (!SWIG_IsOK(ecode2)) {
24804  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_niter_pq_0_set" "', argument " "2"" of type '" "int""'");
24805  }
24806  arg2 = static_cast< int >(val2);
24807  if (arg1) (arg1)->niter_pq_0 = arg2;
24808  resultobj = SWIG_Py_Void();
24809  return resultobj;
24810 fail:
24811  return NULL;
24812 }
24813 
24814 
24815 SWIGINTERN PyObject *_wrap_OPQMatrix_niter_pq_0_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24816  PyObject *resultobj = 0;
24817  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24818  void *argp1 = 0 ;
24819  int res1 = 0 ;
24820  PyObject * obj0 = 0 ;
24821  int result;
24822 
24823  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_niter_pq_0_get",&obj0)) SWIG_fail;
24824  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24825  if (!SWIG_IsOK(res1)) {
24826  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_niter_pq_0_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24827  }
24828  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24829  result = (int) ((arg1)->niter_pq_0);
24830  resultobj = SWIG_From_int(static_cast< int >(result));
24831  return resultobj;
24832 fail:
24833  return NULL;
24834 }
24835 
24836 
24837 SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24838  PyObject *resultobj = 0;
24839  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24840  size_t arg2 ;
24841  void *argp1 = 0 ;
24842  int res1 = 0 ;
24843  size_t val2 ;
24844  int ecode2 = 0 ;
24845  PyObject * obj0 = 0 ;
24846  PyObject * obj1 = 0 ;
24847 
24848  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_max_train_points_set",&obj0,&obj1)) SWIG_fail;
24849  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24850  if (!SWIG_IsOK(res1)) {
24851  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24852  }
24853  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24854  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
24855  if (!SWIG_IsOK(ecode2)) {
24856  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_max_train_points_set" "', argument " "2"" of type '" "size_t""'");
24857  }
24858  arg2 = static_cast< size_t >(val2);
24859  if (arg1) (arg1)->max_train_points = arg2;
24860  resultobj = SWIG_Py_Void();
24861  return resultobj;
24862 fail:
24863  return NULL;
24864 }
24865 
24866 
24867 SWIGINTERN PyObject *_wrap_OPQMatrix_max_train_points_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24868  PyObject *resultobj = 0;
24869  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24870  void *argp1 = 0 ;
24871  int res1 = 0 ;
24872  PyObject * obj0 = 0 ;
24873  size_t result;
24874 
24875  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_max_train_points_get",&obj0)) SWIG_fail;
24876  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24877  if (!SWIG_IsOK(res1)) {
24878  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_max_train_points_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24879  }
24880  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24881  result = (size_t) ((arg1)->max_train_points);
24882  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
24883  return resultobj;
24884 fail:
24885  return NULL;
24886 }
24887 
24888 
24889 SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24890  PyObject *resultobj = 0;
24891  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24892  bool arg2 ;
24893  void *argp1 = 0 ;
24894  int res1 = 0 ;
24895  bool val2 ;
24896  int ecode2 = 0 ;
24897  PyObject * obj0 = 0 ;
24898  PyObject * obj1 = 0 ;
24899 
24900  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_verbose_set",&obj0,&obj1)) SWIG_fail;
24901  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24902  if (!SWIG_IsOK(res1)) {
24903  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24904  }
24905  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24906  ecode2 = SWIG_AsVal_bool(obj1, &val2);
24907  if (!SWIG_IsOK(ecode2)) {
24908  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_verbose_set" "', argument " "2"" of type '" "bool""'");
24909  }
24910  arg2 = static_cast< bool >(val2);
24911  if (arg1) (arg1)->verbose = arg2;
24912  resultobj = SWIG_Py_Void();
24913  return resultobj;
24914 fail:
24915  return NULL;
24916 }
24917 
24918 
24919 SWIGINTERN PyObject *_wrap_OPQMatrix_verbose_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24920  PyObject *resultobj = 0;
24921  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24922  void *argp1 = 0 ;
24923  int res1 = 0 ;
24924  PyObject * obj0 = 0 ;
24925  bool result;
24926 
24927  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_verbose_get",&obj0)) SWIG_fail;
24928  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24929  if (!SWIG_IsOK(res1)) {
24930  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_verbose_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24931  }
24932  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24933  result = (bool) ((arg1)->verbose);
24934  resultobj = SWIG_From_bool(static_cast< bool >(result));
24935  return resultobj;
24936 fail:
24937  return NULL;
24938 }
24939 
24940 
24941 SWIGINTERN PyObject *_wrap_OPQMatrix_pq_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24942  PyObject *resultobj = 0;
24943  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24945  void *argp1 = 0 ;
24946  int res1 = 0 ;
24947  void *argp2 = 0 ;
24948  int res2 = 0 ;
24949  PyObject * obj0 = 0 ;
24950  PyObject * obj1 = 0 ;
24951 
24952  if (!PyArg_ParseTuple(args,(char *)"OO:OPQMatrix_pq_set",&obj0,&obj1)) SWIG_fail;
24953  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24954  if (!SWIG_IsOK(res1)) {
24955  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_set" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24956  }
24957  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24958  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__ProductQuantizer, SWIG_POINTER_DISOWN | 0 );
24959  if (!SWIG_IsOK(res2)) {
24960  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPQMatrix_pq_set" "', argument " "2"" of type '" "faiss::ProductQuantizer *""'");
24961  }
24962  arg2 = reinterpret_cast< faiss::ProductQuantizer * >(argp2);
24963  if (arg1) (arg1)->pq = arg2;
24964  resultobj = SWIG_Py_Void();
24965  return resultobj;
24966 fail:
24967  return NULL;
24968 }
24969 
24970 
24971 SWIGINTERN PyObject *_wrap_OPQMatrix_pq_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24972  PyObject *resultobj = 0;
24973  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
24974  void *argp1 = 0 ;
24975  int res1 = 0 ;
24976  PyObject * obj0 = 0 ;
24977  faiss::ProductQuantizer *result = 0 ;
24978 
24979  if (!PyArg_ParseTuple(args,(char *)"O:OPQMatrix_pq_get",&obj0)) SWIG_fail;
24980  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
24981  if (!SWIG_IsOK(res1)) {
24982  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_pq_get" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
24983  }
24984  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
24985  result = (faiss::ProductQuantizer *) ((arg1)->pq);
24986  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__ProductQuantizer, 0 | 0 );
24987  return resultobj;
24988 fail:
24989  return NULL;
24990 }
24991 
24992 
24993 SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24994  PyObject *resultobj = 0;
24995  int arg1 ;
24996  int arg2 ;
24997  int arg3 ;
24998  int val1 ;
24999  int ecode1 = 0 ;
25000  int val2 ;
25001  int ecode2 = 0 ;
25002  int val3 ;
25003  int ecode3 = 0 ;
25004  PyObject * obj0 = 0 ;
25005  PyObject * obj1 = 0 ;
25006  PyObject * obj2 = 0 ;
25007  faiss::OPQMatrix *result = 0 ;
25008 
25009  if (!PyArg_ParseTuple(args,(char *)"OOO:new_OPQMatrix",&obj0,&obj1,&obj2)) SWIG_fail;
25010  ecode1 = SWIG_AsVal_int(obj0, &val1);
25011  if (!SWIG_IsOK(ecode1)) {
25012  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'");
25013  }
25014  arg1 = static_cast< int >(val1);
25015  ecode2 = SWIG_AsVal_int(obj1, &val2);
25016  if (!SWIG_IsOK(ecode2)) {
25017  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'");
25018  }
25019  arg2 = static_cast< int >(val2);
25020  ecode3 = SWIG_AsVal_int(obj2, &val3);
25021  if (!SWIG_IsOK(ecode3)) {
25022  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_OPQMatrix" "', argument " "3"" of type '" "int""'");
25023  }
25024  arg3 = static_cast< int >(val3);
25025  {
25026  Py_BEGIN_ALLOW_THREADS
25027  try {
25028  result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2,arg3);
25029  } catch(faiss::FaissException & e) {
25030  PyEval_RestoreThread(_save);
25031 
25032  if (PyErr_Occurred()) {
25033  // some previous code already set the error type.
25034  } else {
25035  PyErr_SetString(PyExc_RuntimeError, e.what());
25036  }
25037  SWIG_fail;
25038  }
25039  Py_END_ALLOW_THREADS
25040  }
25041  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 );
25042  return resultobj;
25043 fail:
25044  return NULL;
25045 }
25046 
25047 
25048 SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25049  PyObject *resultobj = 0;
25050  int arg1 ;
25051  int arg2 ;
25052  int val1 ;
25053  int ecode1 = 0 ;
25054  int val2 ;
25055  int ecode2 = 0 ;
25056  PyObject * obj0 = 0 ;
25057  PyObject * obj1 = 0 ;
25058  faiss::OPQMatrix *result = 0 ;
25059 
25060  if (!PyArg_ParseTuple(args,(char *)"OO:new_OPQMatrix",&obj0,&obj1)) SWIG_fail;
25061  ecode1 = SWIG_AsVal_int(obj0, &val1);
25062  if (!SWIG_IsOK(ecode1)) {
25063  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'");
25064  }
25065  arg1 = static_cast< int >(val1);
25066  ecode2 = SWIG_AsVal_int(obj1, &val2);
25067  if (!SWIG_IsOK(ecode2)) {
25068  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_OPQMatrix" "', argument " "2"" of type '" "int""'");
25069  }
25070  arg2 = static_cast< int >(val2);
25071  {
25072  Py_BEGIN_ALLOW_THREADS
25073  try {
25074  result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1,arg2);
25075  } catch(faiss::FaissException & e) {
25076  PyEval_RestoreThread(_save);
25077 
25078  if (PyErr_Occurred()) {
25079  // some previous code already set the error type.
25080  } else {
25081  PyErr_SetString(PyExc_RuntimeError, e.what());
25082  }
25083  SWIG_fail;
25084  }
25085  Py_END_ALLOW_THREADS
25086  }
25087  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 );
25088  return resultobj;
25089 fail:
25090  return NULL;
25091 }
25092 
25093 
25094 SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25095  PyObject *resultobj = 0;
25096  int arg1 ;
25097  int val1 ;
25098  int ecode1 = 0 ;
25099  PyObject * obj0 = 0 ;
25100  faiss::OPQMatrix *result = 0 ;
25101 
25102  if (!PyArg_ParseTuple(args,(char *)"O:new_OPQMatrix",&obj0)) SWIG_fail;
25103  ecode1 = SWIG_AsVal_int(obj0, &val1);
25104  if (!SWIG_IsOK(ecode1)) {
25105  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_OPQMatrix" "', argument " "1"" of type '" "int""'");
25106  }
25107  arg1 = static_cast< int >(val1);
25108  {
25109  Py_BEGIN_ALLOW_THREADS
25110  try {
25111  result = (faiss::OPQMatrix *)new faiss::OPQMatrix(arg1);
25112  } catch(faiss::FaissException & e) {
25113  PyEval_RestoreThread(_save);
25114 
25115  if (PyErr_Occurred()) {
25116  // some previous code already set the error type.
25117  } else {
25118  PyErr_SetString(PyExc_RuntimeError, e.what());
25119  }
25120  SWIG_fail;
25121  }
25122  Py_END_ALLOW_THREADS
25123  }
25124  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 );
25125  return resultobj;
25126 fail:
25127  return NULL;
25128 }
25129 
25130 
25131 SWIGINTERN PyObject *_wrap_new_OPQMatrix__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25132  PyObject *resultobj = 0;
25133  faiss::OPQMatrix *result = 0 ;
25134 
25135  if (!PyArg_ParseTuple(args,(char *)":new_OPQMatrix")) SWIG_fail;
25136  {
25137  Py_BEGIN_ALLOW_THREADS
25138  try {
25139  result = (faiss::OPQMatrix *)new faiss::OPQMatrix();
25140  } catch(faiss::FaissException & e) {
25141  PyEval_RestoreThread(_save);
25142 
25143  if (PyErr_Occurred()) {
25144  // some previous code already set the error type.
25145  } else {
25146  PyErr_SetString(PyExc_RuntimeError, e.what());
25147  }
25148  SWIG_fail;
25149  }
25150  Py_END_ALLOW_THREADS
25151  }
25152  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_NEW | 0 );
25153  return resultobj;
25154 fail:
25155  return NULL;
25156 }
25157 
25158 
25159 SWIGINTERN PyObject *_wrap_new_OPQMatrix(PyObject *self, PyObject *args) {
25160  Py_ssize_t argc;
25161  PyObject *argv[4] = {
25162  0
25163  };
25164  Py_ssize_t ii;
25165 
25166  if (!PyTuple_Check(args)) SWIG_fail;
25167  argc = args ? PyObject_Length(args) : 0;
25168  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
25169  argv[ii] = PyTuple_GET_ITEM(args,ii);
25170  }
25171  if (argc == 0) {
25172  return _wrap_new_OPQMatrix__SWIG_3(self, args);
25173  }
25174  if (argc == 1) {
25175  int _v;
25176  {
25177  int res = SWIG_AsVal_int(argv[0], NULL);
25178  _v = SWIG_CheckState(res);
25179  }
25180  if (_v) {
25181  return _wrap_new_OPQMatrix__SWIG_2(self, args);
25182  }
25183  }
25184  if (argc == 2) {
25185  int _v;
25186  {
25187  int res = SWIG_AsVal_int(argv[0], NULL);
25188  _v = SWIG_CheckState(res);
25189  }
25190  if (_v) {
25191  {
25192  int res = SWIG_AsVal_int(argv[1], NULL);
25193  _v = SWIG_CheckState(res);
25194  }
25195  if (_v) {
25196  return _wrap_new_OPQMatrix__SWIG_1(self, args);
25197  }
25198  }
25199  }
25200  if (argc == 3) {
25201  int _v;
25202  {
25203  int res = SWIG_AsVal_int(argv[0], NULL);
25204  _v = SWIG_CheckState(res);
25205  }
25206  if (_v) {
25207  {
25208  int res = SWIG_AsVal_int(argv[1], NULL);
25209  _v = SWIG_CheckState(res);
25210  }
25211  if (_v) {
25212  {
25213  int res = SWIG_AsVal_int(argv[2], NULL);
25214  _v = SWIG_CheckState(res);
25215  }
25216  if (_v) {
25217  return _wrap_new_OPQMatrix__SWIG_0(self, args);
25218  }
25219  }
25220  }
25221  }
25222 
25223 fail:
25224  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_OPQMatrix'.\n"
25225  " Possible C/C++ prototypes are:\n"
25226  " faiss::OPQMatrix::OPQMatrix(int,int,int)\n"
25227  " faiss::OPQMatrix::OPQMatrix(int,int)\n"
25228  " faiss::OPQMatrix::OPQMatrix(int)\n"
25229  " faiss::OPQMatrix::OPQMatrix()\n");
25230  return 0;
25231 }
25232 
25233 
25234 SWIGINTERN PyObject *_wrap_OPQMatrix_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25235  PyObject *resultobj = 0;
25236  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
25237  faiss::Index::idx_t arg2 ;
25238  float *arg3 = (float *) 0 ;
25239  void *argp1 = 0 ;
25240  int res1 = 0 ;
25241  long val2 ;
25242  int ecode2 = 0 ;
25243  void *argp3 = 0 ;
25244  int res3 = 0 ;
25245  PyObject * obj0 = 0 ;
25246  PyObject * obj1 = 0 ;
25247  PyObject * obj2 = 0 ;
25248 
25249  if (!PyArg_ParseTuple(args,(char *)"OOO:OPQMatrix_train",&obj0,&obj1,&obj2)) SWIG_fail;
25250  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, 0 | 0 );
25251  if (!SWIG_IsOK(res1)) {
25252  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPQMatrix_train" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
25253  }
25254  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
25255  ecode2 = SWIG_AsVal_long(obj1, &val2);
25256  if (!SWIG_IsOK(ecode2)) {
25257  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPQMatrix_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
25258  }
25259  arg2 = static_cast< faiss::Index::idx_t >(val2);
25260  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
25261  if (!SWIG_IsOK(res3)) {
25262  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OPQMatrix_train" "', argument " "3"" of type '" "float const *""'");
25263  }
25264  arg3 = reinterpret_cast< float * >(argp3);
25265  {
25266  Py_BEGIN_ALLOW_THREADS
25267  try {
25268  (arg1)->train(arg2,(float const *)arg3);
25269  } catch(faiss::FaissException & e) {
25270  PyEval_RestoreThread(_save);
25271 
25272  if (PyErr_Occurred()) {
25273  // some previous code already set the error type.
25274  } else {
25275  PyErr_SetString(PyExc_RuntimeError, e.what());
25276  }
25277  SWIG_fail;
25278  }
25279  Py_END_ALLOW_THREADS
25280  }
25281  resultobj = SWIG_Py_Void();
25282  return resultobj;
25283 fail:
25284  return NULL;
25285 }
25286 
25287 
25288 SWIGINTERN PyObject *_wrap_delete_OPQMatrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25289  PyObject *resultobj = 0;
25290  faiss::OPQMatrix *arg1 = (faiss::OPQMatrix *) 0 ;
25291  void *argp1 = 0 ;
25292  int res1 = 0 ;
25293  PyObject * obj0 = 0 ;
25294 
25295  if (!PyArg_ParseTuple(args,(char *)"O:delete_OPQMatrix",&obj0)) SWIG_fail;
25296  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__OPQMatrix, SWIG_POINTER_DISOWN | 0 );
25297  if (!SWIG_IsOK(res1)) {
25298  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_OPQMatrix" "', argument " "1"" of type '" "faiss::OPQMatrix *""'");
25299  }
25300  arg1 = reinterpret_cast< faiss::OPQMatrix * >(argp1);
25301  delete arg1;
25302  resultobj = SWIG_Py_Void();
25303  return resultobj;
25304 fail:
25305  return NULL;
25306 }
25307 
25308 
25309 SWIGINTERN PyObject *OPQMatrix_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25310  PyObject *obj;
25311  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
25312  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__OPQMatrix, SWIG_NewClientData(obj));
25313  return SWIG_Py_Void();
25314 }
25315 
25316 SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25317  PyObject *resultobj = 0;
25319  std::vector< int > *arg2 = (std::vector< int > *) 0 ;
25320  void *argp1 = 0 ;
25321  int res1 = 0 ;
25322  void *argp2 = 0 ;
25323  int res2 = 0 ;
25324  PyObject * obj0 = 0 ;
25325  PyObject * obj1 = 0 ;
25326 
25327  if (!PyArg_ParseTuple(args,(char *)"OO:RemapDimensionsTransform_map_set",&obj0,&obj1)) SWIG_fail;
25328  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 );
25329  if (!SWIG_IsOK(res1)) {
25330  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_set" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'");
25331  }
25332  arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1);
25333  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
25334  if (!SWIG_IsOK(res2)) {
25335  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RemapDimensionsTransform_map_set" "', argument " "2"" of type '" "std::vector< int > *""'");
25336  }
25337  arg2 = reinterpret_cast< std::vector< int > * >(argp2);
25338  if (arg1) (arg1)->map = *arg2;
25339  resultobj = SWIG_Py_Void();
25340  return resultobj;
25341 fail:
25342  return NULL;
25343 }
25344 
25345 
25346 SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_map_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25347  PyObject *resultobj = 0;
25349  void *argp1 = 0 ;
25350  int res1 = 0 ;
25351  PyObject * obj0 = 0 ;
25352  std::vector< int > *result = 0 ;
25353 
25354  if (!PyArg_ParseTuple(args,(char *)"O:RemapDimensionsTransform_map_get",&obj0)) SWIG_fail;
25355  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 );
25356  if (!SWIG_IsOK(res1)) {
25357  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_map_get" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'");
25358  }
25359  arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1);
25360  result = (std::vector< int > *)& ((arg1)->map);
25361  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_t, 0 | 0 );
25362  return resultobj;
25363 fail:
25364  return NULL;
25365 }
25366 
25367 
25368 SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25369  PyObject *resultobj = 0;
25370  int arg1 ;
25371  int arg2 ;
25372  int *arg3 = (int *) 0 ;
25373  int val1 ;
25374  int ecode1 = 0 ;
25375  int val2 ;
25376  int ecode2 = 0 ;
25377  void *argp3 = 0 ;
25378  int res3 = 0 ;
25379  PyObject * obj0 = 0 ;
25380  PyObject * obj1 = 0 ;
25381  PyObject * obj2 = 0 ;
25382  faiss::RemapDimensionsTransform *result = 0 ;
25383 
25384  if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail;
25385  ecode1 = SWIG_AsVal_int(obj0, &val1);
25386  if (!SWIG_IsOK(ecode1)) {
25387  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'");
25388  }
25389  arg1 = static_cast< int >(val1);
25390  ecode2 = SWIG_AsVal_int(obj1, &val2);
25391  if (!SWIG_IsOK(ecode2)) {
25392  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'");
25393  }
25394  arg2 = static_cast< int >(val2);
25395  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 );
25396  if (!SWIG_IsOK(res3)) {
25397  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "int const *""'");
25398  }
25399  arg3 = reinterpret_cast< int * >(argp3);
25400  {
25401  Py_BEGIN_ALLOW_THREADS
25402  try {
25403  result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,(int const *)arg3);
25404  } catch(faiss::FaissException & e) {
25405  PyEval_RestoreThread(_save);
25406 
25407  if (PyErr_Occurred()) {
25408  // some previous code already set the error type.
25409  } else {
25410  PyErr_SetString(PyExc_RuntimeError, e.what());
25411  }
25412  SWIG_fail;
25413  }
25414  Py_END_ALLOW_THREADS
25415  }
25416  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 );
25417  return resultobj;
25418 fail:
25419  return NULL;
25420 }
25421 
25422 
25423 SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25424  PyObject *resultobj = 0;
25425  int arg1 ;
25426  int arg2 ;
25427  bool arg3 ;
25428  int val1 ;
25429  int ecode1 = 0 ;
25430  int val2 ;
25431  int ecode2 = 0 ;
25432  bool val3 ;
25433  int ecode3 = 0 ;
25434  PyObject * obj0 = 0 ;
25435  PyObject * obj1 = 0 ;
25436  PyObject * obj2 = 0 ;
25437  faiss::RemapDimensionsTransform *result = 0 ;
25438 
25439  if (!PyArg_ParseTuple(args,(char *)"OOO:new_RemapDimensionsTransform",&obj0,&obj1,&obj2)) SWIG_fail;
25440  ecode1 = SWIG_AsVal_int(obj0, &val1);
25441  if (!SWIG_IsOK(ecode1)) {
25442  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'");
25443  }
25444  arg1 = static_cast< int >(val1);
25445  ecode2 = SWIG_AsVal_int(obj1, &val2);
25446  if (!SWIG_IsOK(ecode2)) {
25447  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'");
25448  }
25449  arg2 = static_cast< int >(val2);
25450  ecode3 = SWIG_AsVal_bool(obj2, &val3);
25451  if (!SWIG_IsOK(ecode3)) {
25452  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_RemapDimensionsTransform" "', argument " "3"" of type '" "bool""'");
25453  }
25454  arg3 = static_cast< bool >(val3);
25455  {
25456  Py_BEGIN_ALLOW_THREADS
25457  try {
25458  result = (faiss::RemapDimensionsTransform *)new faiss::RemapDimensionsTransform(arg1,arg2,arg3);
25459  } catch(faiss::FaissException & e) {
25460  PyEval_RestoreThread(_save);
25461 
25462  if (PyErr_Occurred()) {
25463  // some previous code already set the error type.
25464  } else {
25465  PyErr_SetString(PyExc_RuntimeError, e.what());
25466  }
25467  SWIG_fail;
25468  }
25469  Py_END_ALLOW_THREADS
25470  }
25471  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 );
25472  return resultobj;
25473 fail:
25474  return NULL;
25475 }
25476 
25477 
25478 SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25479  PyObject *resultobj = 0;
25480  int arg1 ;
25481  int arg2 ;
25482  int val1 ;
25483  int ecode1 = 0 ;
25484  int val2 ;
25485  int ecode2 = 0 ;
25486  PyObject * obj0 = 0 ;
25487  PyObject * obj1 = 0 ;
25488  faiss::RemapDimensionsTransform *result = 0 ;
25489 
25490  if (!PyArg_ParseTuple(args,(char *)"OO:new_RemapDimensionsTransform",&obj0,&obj1)) SWIG_fail;
25491  ecode1 = SWIG_AsVal_int(obj0, &val1);
25492  if (!SWIG_IsOK(ecode1)) {
25493  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_RemapDimensionsTransform" "', argument " "1"" of type '" "int""'");
25494  }
25495  arg1 = static_cast< int >(val1);
25496  ecode2 = SWIG_AsVal_int(obj1, &val2);
25497  if (!SWIG_IsOK(ecode2)) {
25498  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_RemapDimensionsTransform" "', argument " "2"" of type '" "int""'");
25499  }
25500  arg2 = static_cast< int >(val2);
25501  {
25502  Py_BEGIN_ALLOW_THREADS
25503  try {
25505  } catch(faiss::FaissException & e) {
25506  PyEval_RestoreThread(_save);
25507 
25508  if (PyErr_Occurred()) {
25509  // some previous code already set the error type.
25510  } else {
25511  PyErr_SetString(PyExc_RuntimeError, e.what());
25512  }
25513  SWIG_fail;
25514  }
25515  Py_END_ALLOW_THREADS
25516  }
25517  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 );
25518  return resultobj;
25519 fail:
25520  return NULL;
25521 }
25522 
25523 
25524 SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25525  PyObject *resultobj = 0;
25527  faiss::VectorTransform::idx_t arg2 ;
25528  float *arg3 = (float *) 0 ;
25529  float *arg4 = (float *) 0 ;
25530  void *argp1 = 0 ;
25531  int res1 = 0 ;
25532  long val2 ;
25533  int ecode2 = 0 ;
25534  void *argp3 = 0 ;
25535  int res3 = 0 ;
25536  void *argp4 = 0 ;
25537  int res4 = 0 ;
25538  PyObject * obj0 = 0 ;
25539  PyObject * obj1 = 0 ;
25540  PyObject * obj2 = 0 ;
25541  PyObject * obj3 = 0 ;
25542 
25543  if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
25544  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 );
25545  if (!SWIG_IsOK(res1)) {
25546  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'");
25547  }
25548  arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1);
25549  ecode2 = SWIG_AsVal_long(obj1, &val2);
25550  if (!SWIG_IsOK(ecode2)) {
25551  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
25552  }
25553  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
25554  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
25555  if (!SWIG_IsOK(res3)) {
25556  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'");
25557  }
25558  arg3 = reinterpret_cast< float * >(argp3);
25559  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
25560  if (!SWIG_IsOK(res4)) {
25561  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'");
25562  }
25563  arg4 = reinterpret_cast< float * >(argp4);
25564  {
25565  Py_BEGIN_ALLOW_THREADS
25566  try {
25567  ((faiss::RemapDimensionsTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4);
25568  } catch(faiss::FaissException & e) {
25569  PyEval_RestoreThread(_save);
25570 
25571  if (PyErr_Occurred()) {
25572  // some previous code already set the error type.
25573  } else {
25574  PyErr_SetString(PyExc_RuntimeError, e.what());
25575  }
25576  SWIG_fail;
25577  }
25578  Py_END_ALLOW_THREADS
25579  }
25580  resultobj = SWIG_Py_Void();
25581  return resultobj;
25582 fail:
25583  return NULL;
25584 }
25585 
25586 
25587 SWIGINTERN PyObject *_wrap_RemapDimensionsTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25588  PyObject *resultobj = 0;
25590  faiss::VectorTransform::idx_t arg2 ;
25591  float *arg3 = (float *) 0 ;
25592  float *arg4 = (float *) 0 ;
25593  void *argp1 = 0 ;
25594  int res1 = 0 ;
25595  long val2 ;
25596  int ecode2 = 0 ;
25597  void *argp3 = 0 ;
25598  int res3 = 0 ;
25599  void *argp4 = 0 ;
25600  int res4 = 0 ;
25601  PyObject * obj0 = 0 ;
25602  PyObject * obj1 = 0 ;
25603  PyObject * obj2 = 0 ;
25604  PyObject * obj3 = 0 ;
25605 
25606  if (!PyArg_ParseTuple(args,(char *)"OOOO:RemapDimensionsTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
25607  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, 0 | 0 );
25608  if (!SWIG_IsOK(res1)) {
25609  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform const *""'");
25610  }
25611  arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1);
25612  ecode2 = SWIG_AsVal_long(obj1, &val2);
25613  if (!SWIG_IsOK(ecode2)) {
25614  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
25615  }
25616  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
25617  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
25618  if (!SWIG_IsOK(res3)) {
25619  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'");
25620  }
25621  arg3 = reinterpret_cast< float * >(argp3);
25622  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
25623  if (!SWIG_IsOK(res4)) {
25624  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RemapDimensionsTransform_reverse_transform" "', argument " "4"" of type '" "float *""'");
25625  }
25626  arg4 = reinterpret_cast< float * >(argp4);
25627  {
25628  Py_BEGIN_ALLOW_THREADS
25629  try {
25630  ((faiss::RemapDimensionsTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4);
25631  } catch(faiss::FaissException & e) {
25632  PyEval_RestoreThread(_save);
25633 
25634  if (PyErr_Occurred()) {
25635  // some previous code already set the error type.
25636  } else {
25637  PyErr_SetString(PyExc_RuntimeError, e.what());
25638  }
25639  SWIG_fail;
25640  }
25641  Py_END_ALLOW_THREADS
25642  }
25643  resultobj = SWIG_Py_Void();
25644  return resultobj;
25645 fail:
25646  return NULL;
25647 }
25648 
25649 
25650 SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25651  PyObject *resultobj = 0;
25652  faiss::RemapDimensionsTransform *result = 0 ;
25653 
25654  if (!PyArg_ParseTuple(args,(char *)":new_RemapDimensionsTransform")) SWIG_fail;
25655  {
25656  Py_BEGIN_ALLOW_THREADS
25657  try {
25659  } catch(faiss::FaissException & e) {
25660  PyEval_RestoreThread(_save);
25661 
25662  if (PyErr_Occurred()) {
25663  // some previous code already set the error type.
25664  } else {
25665  PyErr_SetString(PyExc_RuntimeError, e.what());
25666  }
25667  SWIG_fail;
25668  }
25669  Py_END_ALLOW_THREADS
25670  }
25671  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_NEW | 0 );
25672  return resultobj;
25673 fail:
25674  return NULL;
25675 }
25676 
25677 
25678 SWIGINTERN PyObject *_wrap_new_RemapDimensionsTransform(PyObject *self, PyObject *args) {
25679  Py_ssize_t argc;
25680  PyObject *argv[4] = {
25681  0
25682  };
25683  Py_ssize_t ii;
25684 
25685  if (!PyTuple_Check(args)) SWIG_fail;
25686  argc = args ? PyObject_Length(args) : 0;
25687  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
25688  argv[ii] = PyTuple_GET_ITEM(args,ii);
25689  }
25690  if (argc == 0) {
25691  return _wrap_new_RemapDimensionsTransform__SWIG_3(self, args);
25692  }
25693  if (argc == 2) {
25694  int _v;
25695  {
25696  int res = SWIG_AsVal_int(argv[0], NULL);
25697  _v = SWIG_CheckState(res);
25698  }
25699  if (_v) {
25700  {
25701  int res = SWIG_AsVal_int(argv[1], NULL);
25702  _v = SWIG_CheckState(res);
25703  }
25704  if (_v) {
25705  return _wrap_new_RemapDimensionsTransform__SWIG_2(self, args);
25706  }
25707  }
25708  }
25709  if (argc == 3) {
25710  int _v;
25711  {
25712  int res = SWIG_AsVal_int(argv[0], NULL);
25713  _v = SWIG_CheckState(res);
25714  }
25715  if (_v) {
25716  {
25717  int res = SWIG_AsVal_int(argv[1], NULL);
25718  _v = SWIG_CheckState(res);
25719  }
25720  if (_v) {
25721  void *vptr = 0;
25722  int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_int, 0);
25723  _v = SWIG_CheckState(res);
25724  if (_v) {
25725  return _wrap_new_RemapDimensionsTransform__SWIG_0(self, args);
25726  }
25727  }
25728  }
25729  }
25730  if (argc == 3) {
25731  int _v;
25732  {
25733  int res = SWIG_AsVal_int(argv[0], NULL);
25734  _v = SWIG_CheckState(res);
25735  }
25736  if (_v) {
25737  {
25738  int res = SWIG_AsVal_int(argv[1], NULL);
25739  _v = SWIG_CheckState(res);
25740  }
25741  if (_v) {
25742  {
25743  int res = SWIG_AsVal_bool(argv[2], NULL);
25744  _v = SWIG_CheckState(res);
25745  }
25746  if (_v) {
25747  return _wrap_new_RemapDimensionsTransform__SWIG_1(self, args);
25748  }
25749  }
25750  }
25751  }
25752 
25753 fail:
25754  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_RemapDimensionsTransform'.\n"
25755  " Possible C/C++ prototypes are:\n"
25756  " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,int const *)\n"
25757  " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int,bool)\n"
25758  " faiss::RemapDimensionsTransform::RemapDimensionsTransform(int,int)\n"
25759  " faiss::RemapDimensionsTransform::RemapDimensionsTransform()\n");
25760  return 0;
25761 }
25762 
25763 
25764 SWIGINTERN PyObject *_wrap_delete_RemapDimensionsTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25765  PyObject *resultobj = 0;
25767  void *argp1 = 0 ;
25768  int res1 = 0 ;
25769  PyObject * obj0 = 0 ;
25770 
25771  if (!PyArg_ParseTuple(args,(char *)"O:delete_RemapDimensionsTransform",&obj0)) SWIG_fail;
25772  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_POINTER_DISOWN | 0 );
25773  if (!SWIG_IsOK(res1)) {
25774  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RemapDimensionsTransform" "', argument " "1"" of type '" "faiss::RemapDimensionsTransform *""'");
25775  }
25776  arg1 = reinterpret_cast< faiss::RemapDimensionsTransform * >(argp1);
25777  delete arg1;
25778  resultobj = SWIG_Py_Void();
25779  return resultobj;
25780 fail:
25781  return NULL;
25782 }
25783 
25784 
25785 SWIGINTERN PyObject *RemapDimensionsTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25786  PyObject *obj;
25787  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
25788  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__RemapDimensionsTransform, SWIG_NewClientData(obj));
25789  return SWIG_Py_Void();
25790 }
25791 
25792 SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25793  PyObject *resultobj = 0;
25795  float arg2 ;
25796  void *argp1 = 0 ;
25797  int res1 = 0 ;
25798  float val2 ;
25799  int ecode2 = 0 ;
25800  PyObject * obj0 = 0 ;
25801  PyObject * obj1 = 0 ;
25802 
25803  if (!PyArg_ParseTuple(args,(char *)"OO:NormalizationTransform_norm_set",&obj0,&obj1)) SWIG_fail;
25804  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 );
25805  if (!SWIG_IsOK(res1)) {
25806  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_set" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'");
25807  }
25808  arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1);
25809  ecode2 = SWIG_AsVal_float(obj1, &val2);
25810  if (!SWIG_IsOK(ecode2)) {
25811  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_norm_set" "', argument " "2"" of type '" "float""'");
25812  }
25813  arg2 = static_cast< float >(val2);
25814  if (arg1) (arg1)->norm = arg2;
25815  resultobj = SWIG_Py_Void();
25816  return resultobj;
25817 fail:
25818  return NULL;
25819 }
25820 
25821 
25822 SWIGINTERN PyObject *_wrap_NormalizationTransform_norm_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25823  PyObject *resultobj = 0;
25825  void *argp1 = 0 ;
25826  int res1 = 0 ;
25827  PyObject * obj0 = 0 ;
25828  float result;
25829 
25830  if (!PyArg_ParseTuple(args,(char *)"O:NormalizationTransform_norm_get",&obj0)) SWIG_fail;
25831  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 );
25832  if (!SWIG_IsOK(res1)) {
25833  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_norm_get" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'");
25834  }
25835  arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1);
25836  result = (float) ((arg1)->norm);
25837  resultobj = SWIG_From_float(static_cast< float >(result));
25838  return resultobj;
25839 fail:
25840  return NULL;
25841 }
25842 
25843 
25844 SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25845  PyObject *resultobj = 0;
25846  int arg1 ;
25847  float arg2 ;
25848  int val1 ;
25849  int ecode1 = 0 ;
25850  float val2 ;
25851  int ecode2 = 0 ;
25852  PyObject * obj0 = 0 ;
25853  PyObject * obj1 = 0 ;
25854  faiss::NormalizationTransform *result = 0 ;
25855 
25856  if (!PyArg_ParseTuple(args,(char *)"OO:new_NormalizationTransform",&obj0,&obj1)) SWIG_fail;
25857  ecode1 = SWIG_AsVal_int(obj0, &val1);
25858  if (!SWIG_IsOK(ecode1)) {
25859  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'");
25860  }
25861  arg1 = static_cast< int >(val1);
25862  ecode2 = SWIG_AsVal_float(obj1, &val2);
25863  if (!SWIG_IsOK(ecode2)) {
25864  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_NormalizationTransform" "', argument " "2"" of type '" "float""'");
25865  }
25866  arg2 = static_cast< float >(val2);
25867  {
25868  Py_BEGIN_ALLOW_THREADS
25869  try {
25871  } catch(faiss::FaissException & e) {
25872  PyEval_RestoreThread(_save);
25873 
25874  if (PyErr_Occurred()) {
25875  // some previous code already set the error type.
25876  } else {
25877  PyErr_SetString(PyExc_RuntimeError, e.what());
25878  }
25879  SWIG_fail;
25880  }
25881  Py_END_ALLOW_THREADS
25882  }
25883  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 );
25884  return resultobj;
25885 fail:
25886  return NULL;
25887 }
25888 
25889 
25890 SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25891  PyObject *resultobj = 0;
25892  int arg1 ;
25893  int val1 ;
25894  int ecode1 = 0 ;
25895  PyObject * obj0 = 0 ;
25896  faiss::NormalizationTransform *result = 0 ;
25897 
25898  if (!PyArg_ParseTuple(args,(char *)"O:new_NormalizationTransform",&obj0)) SWIG_fail;
25899  ecode1 = SWIG_AsVal_int(obj0, &val1);
25900  if (!SWIG_IsOK(ecode1)) {
25901  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_NormalizationTransform" "', argument " "1"" of type '" "int""'");
25902  }
25903  arg1 = static_cast< int >(val1);
25904  {
25905  Py_BEGIN_ALLOW_THREADS
25906  try {
25908  } catch(faiss::FaissException & e) {
25909  PyEval_RestoreThread(_save);
25910 
25911  if (PyErr_Occurred()) {
25912  // some previous code already set the error type.
25913  } else {
25914  PyErr_SetString(PyExc_RuntimeError, e.what());
25915  }
25916  SWIG_fail;
25917  }
25918  Py_END_ALLOW_THREADS
25919  }
25920  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 );
25921  return resultobj;
25922 fail:
25923  return NULL;
25924 }
25925 
25926 
25927 SWIGINTERN PyObject *_wrap_new_NormalizationTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25928  PyObject *resultobj = 0;
25929  faiss::NormalizationTransform *result = 0 ;
25930 
25931  if (!PyArg_ParseTuple(args,(char *)":new_NormalizationTransform")) SWIG_fail;
25932  {
25933  Py_BEGIN_ALLOW_THREADS
25934  try {
25936  } catch(faiss::FaissException & e) {
25937  PyEval_RestoreThread(_save);
25938 
25939  if (PyErr_Occurred()) {
25940  // some previous code already set the error type.
25941  } else {
25942  PyErr_SetString(PyExc_RuntimeError, e.what());
25943  }
25944  SWIG_fail;
25945  }
25946  Py_END_ALLOW_THREADS
25947  }
25948  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_NEW | 0 );
25949  return resultobj;
25950 fail:
25951  return NULL;
25952 }
25953 
25954 
25955 SWIGINTERN PyObject *_wrap_new_NormalizationTransform(PyObject *self, PyObject *args) {
25956  Py_ssize_t argc;
25957  PyObject *argv[3] = {
25958  0
25959  };
25960  Py_ssize_t ii;
25961 
25962  if (!PyTuple_Check(args)) SWIG_fail;
25963  argc = args ? PyObject_Length(args) : 0;
25964  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
25965  argv[ii] = PyTuple_GET_ITEM(args,ii);
25966  }
25967  if (argc == 0) {
25968  return _wrap_new_NormalizationTransform__SWIG_2(self, args);
25969  }
25970  if (argc == 1) {
25971  int _v;
25972  {
25973  int res = SWIG_AsVal_int(argv[0], NULL);
25974  _v = SWIG_CheckState(res);
25975  }
25976  if (_v) {
25977  return _wrap_new_NormalizationTransform__SWIG_1(self, args);
25978  }
25979  }
25980  if (argc == 2) {
25981  int _v;
25982  {
25983  int res = SWIG_AsVal_int(argv[0], NULL);
25984  _v = SWIG_CheckState(res);
25985  }
25986  if (_v) {
25987  {
25988  int res = SWIG_AsVal_float(argv[1], NULL);
25989  _v = SWIG_CheckState(res);
25990  }
25991  if (_v) {
25992  return _wrap_new_NormalizationTransform__SWIG_0(self, args);
25993  }
25994  }
25995  }
25996 
25997 fail:
25998  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_NormalizationTransform'.\n"
25999  " Possible C/C++ prototypes are:\n"
26000  " faiss::NormalizationTransform::NormalizationTransform(int,float)\n"
26001  " faiss::NormalizationTransform::NormalizationTransform(int)\n"
26002  " faiss::NormalizationTransform::NormalizationTransform()\n");
26003  return 0;
26004 }
26005 
26006 
26007 SWIGINTERN PyObject *_wrap_NormalizationTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26008  PyObject *resultobj = 0;
26010  faiss::VectorTransform::idx_t arg2 ;
26011  float *arg3 = (float *) 0 ;
26012  float *arg4 = (float *) 0 ;
26013  void *argp1 = 0 ;
26014  int res1 = 0 ;
26015  long val2 ;
26016  int ecode2 = 0 ;
26017  void *argp3 = 0 ;
26018  int res3 = 0 ;
26019  void *argp4 = 0 ;
26020  int res4 = 0 ;
26021  PyObject * obj0 = 0 ;
26022  PyObject * obj1 = 0 ;
26023  PyObject * obj2 = 0 ;
26024  PyObject * obj3 = 0 ;
26025 
26026  if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
26027  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 );
26028  if (!SWIG_IsOK(res1)) {
26029  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'");
26030  }
26031  arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1);
26032  ecode2 = SWIG_AsVal_long(obj1, &val2);
26033  if (!SWIG_IsOK(ecode2)) {
26034  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
26035  }
26036  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
26037  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26038  if (!SWIG_IsOK(res3)) {
26039  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'");
26040  }
26041  arg3 = reinterpret_cast< float * >(argp3);
26042  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
26043  if (!SWIG_IsOK(res4)) {
26044  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'");
26045  }
26046  arg4 = reinterpret_cast< float * >(argp4);
26047  {
26048  Py_BEGIN_ALLOW_THREADS
26049  try {
26050  ((faiss::NormalizationTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4);
26051  } catch(faiss::FaissException & e) {
26052  PyEval_RestoreThread(_save);
26053 
26054  if (PyErr_Occurred()) {
26055  // some previous code already set the error type.
26056  } else {
26057  PyErr_SetString(PyExc_RuntimeError, e.what());
26058  }
26059  SWIG_fail;
26060  }
26061  Py_END_ALLOW_THREADS
26062  }
26063  resultobj = SWIG_Py_Void();
26064  return resultobj;
26065 fail:
26066  return NULL;
26067 }
26068 
26069 
26070 SWIGINTERN PyObject *_wrap_NormalizationTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26071  PyObject *resultobj = 0;
26073  faiss::VectorTransform::idx_t arg2 ;
26074  float *arg3 = (float *) 0 ;
26075  float *arg4 = (float *) 0 ;
26076  void *argp1 = 0 ;
26077  int res1 = 0 ;
26078  long val2 ;
26079  int ecode2 = 0 ;
26080  void *argp3 = 0 ;
26081  int res3 = 0 ;
26082  void *argp4 = 0 ;
26083  int res4 = 0 ;
26084  PyObject * obj0 = 0 ;
26085  PyObject * obj1 = 0 ;
26086  PyObject * obj2 = 0 ;
26087  PyObject * obj3 = 0 ;
26088 
26089  if (!PyArg_ParseTuple(args,(char *)"OOOO:NormalizationTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
26090  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, 0 | 0 );
26091  if (!SWIG_IsOK(res1)) {
26092  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "NormalizationTransform_reverse_transform" "', argument " "1"" of type '" "faiss::NormalizationTransform const *""'");
26093  }
26094  arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1);
26095  ecode2 = SWIG_AsVal_long(obj1, &val2);
26096  if (!SWIG_IsOK(ecode2)) {
26097  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "NormalizationTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
26098  }
26099  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
26100  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26101  if (!SWIG_IsOK(res3)) {
26102  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "NormalizationTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'");
26103  }
26104  arg3 = reinterpret_cast< float * >(argp3);
26105  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
26106  if (!SWIG_IsOK(res4)) {
26107  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "NormalizationTransform_reverse_transform" "', argument " "4"" of type '" "float *""'");
26108  }
26109  arg4 = reinterpret_cast< float * >(argp4);
26110  {
26111  Py_BEGIN_ALLOW_THREADS
26112  try {
26113  ((faiss::NormalizationTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4);
26114  } catch(faiss::FaissException & e) {
26115  PyEval_RestoreThread(_save);
26116 
26117  if (PyErr_Occurred()) {
26118  // some previous code already set the error type.
26119  } else {
26120  PyErr_SetString(PyExc_RuntimeError, e.what());
26121  }
26122  SWIG_fail;
26123  }
26124  Py_END_ALLOW_THREADS
26125  }
26126  resultobj = SWIG_Py_Void();
26127  return resultobj;
26128 fail:
26129  return NULL;
26130 }
26131 
26132 
26133 SWIGINTERN PyObject *_wrap_delete_NormalizationTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26134  PyObject *resultobj = 0;
26136  void *argp1 = 0 ;
26137  int res1 = 0 ;
26138  PyObject * obj0 = 0 ;
26139 
26140  if (!PyArg_ParseTuple(args,(char *)"O:delete_NormalizationTransform",&obj0)) SWIG_fail;
26141  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__NormalizationTransform, SWIG_POINTER_DISOWN | 0 );
26142  if (!SWIG_IsOK(res1)) {
26143  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_NormalizationTransform" "', argument " "1"" of type '" "faiss::NormalizationTransform *""'");
26144  }
26145  arg1 = reinterpret_cast< faiss::NormalizationTransform * >(argp1);
26146  delete arg1;
26147  resultobj = SWIG_Py_Void();
26148  return resultobj;
26149 fail:
26150  return NULL;
26151 }
26152 
26153 
26154 SWIGINTERN PyObject *NormalizationTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26155  PyObject *obj;
26156  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
26157  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__NormalizationTransform, SWIG_NewClientData(obj));
26158  return SWIG_Py_Void();
26159 }
26160 
26161 SWIGINTERN PyObject *_wrap_CenteringTransform_mean_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26162  PyObject *resultobj = 0;
26164  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
26165  void *argp1 = 0 ;
26166  int res1 = 0 ;
26167  void *argp2 = 0 ;
26168  int res2 = 0 ;
26169  PyObject * obj0 = 0 ;
26170  PyObject * obj1 = 0 ;
26171 
26172  if (!PyArg_ParseTuple(args,(char *)"OO:CenteringTransform_mean_set",&obj0,&obj1)) SWIG_fail;
26173  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 );
26174  if (!SWIG_IsOK(res1)) {
26175  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_set" "', argument " "1"" of type '" "faiss::CenteringTransform *""'");
26176  }
26177  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26178  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
26179  if (!SWIG_IsOK(res2)) {
26180  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CenteringTransform_mean_set" "', argument " "2"" of type '" "std::vector< float > *""'");
26181  }
26182  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
26183  if (arg1) (arg1)->mean = *arg2;
26184  resultobj = SWIG_Py_Void();
26185  return resultobj;
26186 fail:
26187  return NULL;
26188 }
26189 
26190 
26191 SWIGINTERN PyObject *_wrap_CenteringTransform_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26192  PyObject *resultobj = 0;
26194  void *argp1 = 0 ;
26195  int res1 = 0 ;
26196  PyObject * obj0 = 0 ;
26197  std::vector< float > *result = 0 ;
26198 
26199  if (!PyArg_ParseTuple(args,(char *)"O:CenteringTransform_mean_get",&obj0)) SWIG_fail;
26200  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 );
26201  if (!SWIG_IsOK(res1)) {
26202  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_mean_get" "', argument " "1"" of type '" "faiss::CenteringTransform *""'");
26203  }
26204  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26205  result = (std::vector< float > *)& ((arg1)->mean);
26206  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
26207  return resultobj;
26208 fail:
26209  return NULL;
26210 }
26211 
26212 
26213 SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26214  PyObject *resultobj = 0;
26215  int arg1 ;
26216  int val1 ;
26217  int ecode1 = 0 ;
26218  PyObject * obj0 = 0 ;
26219  faiss::CenteringTransform *result = 0 ;
26220 
26221  if (!PyArg_ParseTuple(args,(char *)"O:new_CenteringTransform",&obj0)) SWIG_fail;
26222  ecode1 = SWIG_AsVal_int(obj0, &val1);
26223  if (!SWIG_IsOK(ecode1)) {
26224  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CenteringTransform" "', argument " "1"" of type '" "int""'");
26225  }
26226  arg1 = static_cast< int >(val1);
26227  {
26228  Py_BEGIN_ALLOW_THREADS
26229  try {
26231  } catch(faiss::FaissException & e) {
26232  PyEval_RestoreThread(_save);
26233 
26234  if (PyErr_Occurred()) {
26235  // some previous code already set the error type.
26236  } else {
26237  PyErr_SetString(PyExc_RuntimeError, e.what());
26238  }
26239  SWIG_fail;
26240  }
26241  Py_END_ALLOW_THREADS
26242  }
26243  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 );
26244  return resultobj;
26245 fail:
26246  return NULL;
26247 }
26248 
26249 
26250 SWIGINTERN PyObject *_wrap_new_CenteringTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26251  PyObject *resultobj = 0;
26252  faiss::CenteringTransform *result = 0 ;
26253 
26254  if (!PyArg_ParseTuple(args,(char *)":new_CenteringTransform")) SWIG_fail;
26255  {
26256  Py_BEGIN_ALLOW_THREADS
26257  try {
26259  } catch(faiss::FaissException & e) {
26260  PyEval_RestoreThread(_save);
26261 
26262  if (PyErr_Occurred()) {
26263  // some previous code already set the error type.
26264  } else {
26265  PyErr_SetString(PyExc_RuntimeError, e.what());
26266  }
26267  SWIG_fail;
26268  }
26269  Py_END_ALLOW_THREADS
26270  }
26271  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_NEW | 0 );
26272  return resultobj;
26273 fail:
26274  return NULL;
26275 }
26276 
26277 
26278 SWIGINTERN PyObject *_wrap_new_CenteringTransform(PyObject *self, PyObject *args) {
26279  Py_ssize_t argc;
26280  PyObject *argv[2] = {
26281  0
26282  };
26283  Py_ssize_t ii;
26284 
26285  if (!PyTuple_Check(args)) SWIG_fail;
26286  argc = args ? PyObject_Length(args) : 0;
26287  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
26288  argv[ii] = PyTuple_GET_ITEM(args,ii);
26289  }
26290  if (argc == 0) {
26291  return _wrap_new_CenteringTransform__SWIG_1(self, args);
26292  }
26293  if (argc == 1) {
26294  int _v;
26295  {
26296  int res = SWIG_AsVal_int(argv[0], NULL);
26297  _v = SWIG_CheckState(res);
26298  }
26299  if (_v) {
26300  return _wrap_new_CenteringTransform__SWIG_0(self, args);
26301  }
26302  }
26303 
26304 fail:
26305  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CenteringTransform'.\n"
26306  " Possible C/C++ prototypes are:\n"
26307  " faiss::CenteringTransform::CenteringTransform(int)\n"
26308  " faiss::CenteringTransform::CenteringTransform()\n");
26309  return 0;
26310 }
26311 
26312 
26313 SWIGINTERN PyObject *_wrap_CenteringTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26314  PyObject *resultobj = 0;
26316  faiss::Index::idx_t arg2 ;
26317  float *arg3 = (float *) 0 ;
26318  void *argp1 = 0 ;
26319  int res1 = 0 ;
26320  long val2 ;
26321  int ecode2 = 0 ;
26322  void *argp3 = 0 ;
26323  int res3 = 0 ;
26324  PyObject * obj0 = 0 ;
26325  PyObject * obj1 = 0 ;
26326  PyObject * obj2 = 0 ;
26327 
26328  if (!PyArg_ParseTuple(args,(char *)"OOO:CenteringTransform_train",&obj0,&obj1,&obj2)) SWIG_fail;
26329  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 );
26330  if (!SWIG_IsOK(res1)) {
26331  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_train" "', argument " "1"" of type '" "faiss::CenteringTransform *""'");
26332  }
26333  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26334  ecode2 = SWIG_AsVal_long(obj1, &val2);
26335  if (!SWIG_IsOK(ecode2)) {
26336  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
26337  }
26338  arg2 = static_cast< faiss::Index::idx_t >(val2);
26339  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26340  if (!SWIG_IsOK(res3)) {
26341  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_train" "', argument " "3"" of type '" "float const *""'");
26342  }
26343  arg3 = reinterpret_cast< float * >(argp3);
26344  {
26345  Py_BEGIN_ALLOW_THREADS
26346  try {
26347  (arg1)->train(arg2,(float const *)arg3);
26348  } catch(faiss::FaissException & e) {
26349  PyEval_RestoreThread(_save);
26350 
26351  if (PyErr_Occurred()) {
26352  // some previous code already set the error type.
26353  } else {
26354  PyErr_SetString(PyExc_RuntimeError, e.what());
26355  }
26356  SWIG_fail;
26357  }
26358  Py_END_ALLOW_THREADS
26359  }
26360  resultobj = SWIG_Py_Void();
26361  return resultobj;
26362 fail:
26363  return NULL;
26364 }
26365 
26366 
26367 SWIGINTERN PyObject *_wrap_CenteringTransform_apply_noalloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26368  PyObject *resultobj = 0;
26370  faiss::VectorTransform::idx_t arg2 ;
26371  float *arg3 = (float *) 0 ;
26372  float *arg4 = (float *) 0 ;
26373  void *argp1 = 0 ;
26374  int res1 = 0 ;
26375  long val2 ;
26376  int ecode2 = 0 ;
26377  void *argp3 = 0 ;
26378  int res3 = 0 ;
26379  void *argp4 = 0 ;
26380  int res4 = 0 ;
26381  PyObject * obj0 = 0 ;
26382  PyObject * obj1 = 0 ;
26383  PyObject * obj2 = 0 ;
26384  PyObject * obj3 = 0 ;
26385 
26386  if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_apply_noalloc",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
26387  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 );
26388  if (!SWIG_IsOK(res1)) {
26389  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_apply_noalloc" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'");
26390  }
26391  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26392  ecode2 = SWIG_AsVal_long(obj1, &val2);
26393  if (!SWIG_IsOK(ecode2)) {
26394  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_apply_noalloc" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
26395  }
26396  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
26397  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26398  if (!SWIG_IsOK(res3)) {
26399  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_apply_noalloc" "', argument " "3"" of type '" "float const *""'");
26400  }
26401  arg3 = reinterpret_cast< float * >(argp3);
26402  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
26403  if (!SWIG_IsOK(res4)) {
26404  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_apply_noalloc" "', argument " "4"" of type '" "float *""'");
26405  }
26406  arg4 = reinterpret_cast< float * >(argp4);
26407  {
26408  Py_BEGIN_ALLOW_THREADS
26409  try {
26410  ((faiss::CenteringTransform const *)arg1)->apply_noalloc(arg2,(float const *)arg3,arg4);
26411  } catch(faiss::FaissException & e) {
26412  PyEval_RestoreThread(_save);
26413 
26414  if (PyErr_Occurred()) {
26415  // some previous code already set the error type.
26416  } else {
26417  PyErr_SetString(PyExc_RuntimeError, e.what());
26418  }
26419  SWIG_fail;
26420  }
26421  Py_END_ALLOW_THREADS
26422  }
26423  resultobj = SWIG_Py_Void();
26424  return resultobj;
26425 fail:
26426  return NULL;
26427 }
26428 
26429 
26430 SWIGINTERN PyObject *_wrap_CenteringTransform_reverse_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26431  PyObject *resultobj = 0;
26433  faiss::VectorTransform::idx_t arg2 ;
26434  float *arg3 = (float *) 0 ;
26435  float *arg4 = (float *) 0 ;
26436  void *argp1 = 0 ;
26437  int res1 = 0 ;
26438  long val2 ;
26439  int ecode2 = 0 ;
26440  void *argp3 = 0 ;
26441  int res3 = 0 ;
26442  void *argp4 = 0 ;
26443  int res4 = 0 ;
26444  PyObject * obj0 = 0 ;
26445  PyObject * obj1 = 0 ;
26446  PyObject * obj2 = 0 ;
26447  PyObject * obj3 = 0 ;
26448 
26449  if (!PyArg_ParseTuple(args,(char *)"OOOO:CenteringTransform_reverse_transform",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
26450  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, 0 | 0 );
26451  if (!SWIG_IsOK(res1)) {
26452  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CenteringTransform_reverse_transform" "', argument " "1"" of type '" "faiss::CenteringTransform const *""'");
26453  }
26454  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26455  ecode2 = SWIG_AsVal_long(obj1, &val2);
26456  if (!SWIG_IsOK(ecode2)) {
26457  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CenteringTransform_reverse_transform" "', argument " "2"" of type '" "faiss::VectorTransform::idx_t""'");
26458  }
26459  arg2 = static_cast< faiss::VectorTransform::idx_t >(val2);
26460  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26461  if (!SWIG_IsOK(res3)) {
26462  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CenteringTransform_reverse_transform" "', argument " "3"" of type '" "float const *""'");
26463  }
26464  arg3 = reinterpret_cast< float * >(argp3);
26465  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
26466  if (!SWIG_IsOK(res4)) {
26467  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "CenteringTransform_reverse_transform" "', argument " "4"" of type '" "float *""'");
26468  }
26469  arg4 = reinterpret_cast< float * >(argp4);
26470  {
26471  Py_BEGIN_ALLOW_THREADS
26472  try {
26473  ((faiss::CenteringTransform const *)arg1)->reverse_transform(arg2,(float const *)arg3,arg4);
26474  } catch(faiss::FaissException & e) {
26475  PyEval_RestoreThread(_save);
26476 
26477  if (PyErr_Occurred()) {
26478  // some previous code already set the error type.
26479  } else {
26480  PyErr_SetString(PyExc_RuntimeError, e.what());
26481  }
26482  SWIG_fail;
26483  }
26484  Py_END_ALLOW_THREADS
26485  }
26486  resultobj = SWIG_Py_Void();
26487  return resultobj;
26488 fail:
26489  return NULL;
26490 }
26491 
26492 
26493 SWIGINTERN PyObject *_wrap_delete_CenteringTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26494  PyObject *resultobj = 0;
26496  void *argp1 = 0 ;
26497  int res1 = 0 ;
26498  PyObject * obj0 = 0 ;
26499 
26500  if (!PyArg_ParseTuple(args,(char *)"O:delete_CenteringTransform",&obj0)) SWIG_fail;
26501  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__CenteringTransform, SWIG_POINTER_DISOWN | 0 );
26502  if (!SWIG_IsOK(res1)) {
26503  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CenteringTransform" "', argument " "1"" of type '" "faiss::CenteringTransform *""'");
26504  }
26505  arg1 = reinterpret_cast< faiss::CenteringTransform * >(argp1);
26506  delete arg1;
26507  resultobj = SWIG_Py_Void();
26508  return resultobj;
26509 fail:
26510  return NULL;
26511 }
26512 
26513 
26514 SWIGINTERN PyObject *CenteringTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26515  PyObject *obj;
26516  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
26517  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__CenteringTransform, SWIG_NewClientData(obj));
26518  return SWIG_Py_Void();
26519 }
26520 
26521 SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26522  PyObject *resultobj = 0;
26524  std::vector< faiss::VectorTransform * > *arg2 = (std::vector< faiss::VectorTransform * > *) 0 ;
26525  void *argp1 = 0 ;
26526  int res1 = 0 ;
26527  void *argp2 = 0 ;
26528  int res2 = 0 ;
26529  PyObject * obj0 = 0 ;
26530  PyObject * obj1 = 0 ;
26531 
26532  if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_chain_set",&obj0,&obj1)) SWIG_fail;
26533  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26534  if (!SWIG_IsOK(res1)) {
26535  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26536  }
26537  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26538  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
26539  if (!SWIG_IsOK(res2)) {
26540  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_chain_set" "', argument " "2"" of type '" "std::vector< faiss::VectorTransform * > *""'");
26541  }
26542  arg2 = reinterpret_cast< std::vector< faiss::VectorTransform * > * >(argp2);
26543  if (arg1) (arg1)->chain = *arg2;
26544  resultobj = SWIG_Py_Void();
26545  return resultobj;
26546 fail:
26547  return NULL;
26548 }
26549 
26550 
26551 SWIGINTERN PyObject *_wrap_IndexPreTransform_chain_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26552  PyObject *resultobj = 0;
26554  void *argp1 = 0 ;
26555  int res1 = 0 ;
26556  PyObject * obj0 = 0 ;
26557  std::vector< faiss::VectorTransform * > *result = 0 ;
26558 
26559  if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_chain_get",&obj0)) SWIG_fail;
26560  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26561  if (!SWIG_IsOK(res1)) {
26562  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_chain_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26563  }
26564  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26565  result = (std::vector< faiss::VectorTransform * > *)& ((arg1)->chain);
26566  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_faiss__VectorTransform_p_t, 0 | 0 );
26567  return resultobj;
26568 fail:
26569  return NULL;
26570 }
26571 
26572 
26573 SWIGINTERN PyObject *_wrap_IndexPreTransform_index_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26574  PyObject *resultobj = 0;
26576  faiss::Index *arg2 = (faiss::Index *) 0 ;
26577  void *argp1 = 0 ;
26578  int res1 = 0 ;
26579  void *argp2 = 0 ;
26580  int res2 = 0 ;
26581  PyObject * obj0 = 0 ;
26582  PyObject * obj1 = 0 ;
26583 
26584  if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_index_set",&obj0,&obj1)) SWIG_fail;
26585  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26586  if (!SWIG_IsOK(res1)) {
26587  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26588  }
26589  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26590  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, SWIG_POINTER_DISOWN | 0 );
26591  if (!SWIG_IsOK(res2)) {
26592  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_index_set" "', argument " "2"" of type '" "faiss::Index *""'");
26593  }
26594  arg2 = reinterpret_cast< faiss::Index * >(argp2);
26595  if (arg1) (arg1)->index = arg2;
26596  resultobj = SWIG_Py_Void();
26597  return resultobj;
26598 fail:
26599  return NULL;
26600 }
26601 
26602 
26603 SWIGINTERN PyObject *_wrap_IndexPreTransform_index_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26604  PyObject *resultobj = 0;
26606  void *argp1 = 0 ;
26607  int res1 = 0 ;
26608  PyObject * obj0 = 0 ;
26609  faiss::Index *result = 0 ;
26610 
26611  if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_index_get",&obj0)) SWIG_fail;
26612  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26613  if (!SWIG_IsOK(res1)) {
26614  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_index_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26615  }
26616  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26617  result = (faiss::Index *) ((arg1)->index);
26618  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__Index, 0 | 0 );
26619  return resultobj;
26620 fail:
26621  return NULL;
26622 }
26623 
26624 
26625 SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26626  PyObject *resultobj = 0;
26628  bool arg2 ;
26629  void *argp1 = 0 ;
26630  int res1 = 0 ;
26631  bool val2 ;
26632  int ecode2 = 0 ;
26633  PyObject * obj0 = 0 ;
26634  PyObject * obj1 = 0 ;
26635 
26636  if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_own_fields_set",&obj0,&obj1)) SWIG_fail;
26637  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26638  if (!SWIG_IsOK(res1)) {
26639  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_set" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26640  }
26641  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26642  ecode2 = SWIG_AsVal_bool(obj1, &val2);
26643  if (!SWIG_IsOK(ecode2)) {
26644  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_own_fields_set" "', argument " "2"" of type '" "bool""'");
26645  }
26646  arg2 = static_cast< bool >(val2);
26647  if (arg1) (arg1)->own_fields = arg2;
26648  resultobj = SWIG_Py_Void();
26649  return resultobj;
26650 fail:
26651  return NULL;
26652 }
26653 
26654 
26655 SWIGINTERN PyObject *_wrap_IndexPreTransform_own_fields_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26656  PyObject *resultobj = 0;
26658  void *argp1 = 0 ;
26659  int res1 = 0 ;
26660  PyObject * obj0 = 0 ;
26661  bool result;
26662 
26663  if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_own_fields_get",&obj0)) SWIG_fail;
26664  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26665  if (!SWIG_IsOK(res1)) {
26666  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_own_fields_get" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26667  }
26668  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26669  result = (bool) ((arg1)->own_fields);
26670  resultobj = SWIG_From_bool(static_cast< bool >(result));
26671  return resultobj;
26672 fail:
26673  return NULL;
26674 }
26675 
26676 
26677 SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26678  PyObject *resultobj = 0;
26679  faiss::Index *arg1 = (faiss::Index *) 0 ;
26680  void *argp1 = 0 ;
26681  int res1 = 0 ;
26682  PyObject * obj0 = 0 ;
26683  faiss::IndexPreTransform *result = 0 ;
26684 
26685  if (!PyArg_ParseTuple(args,(char *)"O:new_IndexPreTransform",&obj0)) SWIG_fail;
26686  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__Index, 0 | 0 );
26687  if (!SWIG_IsOK(res1)) {
26688  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::Index *""'");
26689  }
26690  arg1 = reinterpret_cast< faiss::Index * >(argp1);
26691  {
26692  Py_BEGIN_ALLOW_THREADS
26693  try {
26694  result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1);
26695  } catch(faiss::FaissException & e) {
26696  PyEval_RestoreThread(_save);
26697 
26698  if (PyErr_Occurred()) {
26699  // some previous code already set the error type.
26700  } else {
26701  PyErr_SetString(PyExc_RuntimeError, e.what());
26702  }
26703  SWIG_fail;
26704  }
26705  Py_END_ALLOW_THREADS
26706  }
26707  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 );
26708  return resultobj;
26709 fail:
26710  return NULL;
26711 }
26712 
26713 
26714 SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26715  PyObject *resultobj = 0;
26716  faiss::IndexPreTransform *result = 0 ;
26717 
26718  if (!PyArg_ParseTuple(args,(char *)":new_IndexPreTransform")) SWIG_fail;
26719  {
26720  Py_BEGIN_ALLOW_THREADS
26721  try {
26723  } catch(faiss::FaissException & e) {
26724  PyEval_RestoreThread(_save);
26725 
26726  if (PyErr_Occurred()) {
26727  // some previous code already set the error type.
26728  } else {
26729  PyErr_SetString(PyExc_RuntimeError, e.what());
26730  }
26731  SWIG_fail;
26732  }
26733  Py_END_ALLOW_THREADS
26734  }
26735  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 );
26736  return resultobj;
26737 fail:
26738  return NULL;
26739 }
26740 
26741 
26742 SWIGINTERN PyObject *_wrap_new_IndexPreTransform__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26743  PyObject *resultobj = 0;
26745  faiss::Index *arg2 = (faiss::Index *) 0 ;
26746  void *argp1 = 0 ;
26747  int res1 = 0 ;
26748  void *argp2 = 0 ;
26749  int res2 = 0 ;
26750  PyObject * obj0 = 0 ;
26751  PyObject * obj1 = 0 ;
26752  faiss::IndexPreTransform *result = 0 ;
26753 
26754  if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexPreTransform",&obj0,&obj1)) SWIG_fail;
26755  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
26756  if (!SWIG_IsOK(res1)) {
26757  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IndexPreTransform" "', argument " "1"" of type '" "faiss::VectorTransform *""'");
26758  }
26759  arg1 = reinterpret_cast< faiss::VectorTransform * >(argp1);
26760  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__Index, 0 | 0 );
26761  if (!SWIG_IsOK(res2)) {
26762  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IndexPreTransform" "', argument " "2"" of type '" "faiss::Index *""'");
26763  }
26764  arg2 = reinterpret_cast< faiss::Index * >(argp2);
26765  {
26766  Py_BEGIN_ALLOW_THREADS
26767  try {
26768  result = (faiss::IndexPreTransform *)new faiss::IndexPreTransform(arg1,arg2);
26769  } catch(faiss::FaissException & e) {
26770  PyEval_RestoreThread(_save);
26771 
26772  if (PyErr_Occurred()) {
26773  // some previous code already set the error type.
26774  } else {
26775  PyErr_SetString(PyExc_RuntimeError, e.what());
26776  }
26777  SWIG_fail;
26778  }
26779  Py_END_ALLOW_THREADS
26780  }
26781  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_NEW | 0 );
26782  return resultobj;
26783 fail:
26784  return NULL;
26785 }
26786 
26787 
26788 SWIGINTERN PyObject *_wrap_new_IndexPreTransform(PyObject *self, PyObject *args) {
26789  Py_ssize_t argc;
26790  PyObject *argv[3] = {
26791  0
26792  };
26793  Py_ssize_t ii;
26794 
26795  if (!PyTuple_Check(args)) SWIG_fail;
26796  argc = args ? PyObject_Length(args) : 0;
26797  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
26798  argv[ii] = PyTuple_GET_ITEM(args,ii);
26799  }
26800  if (argc == 0) {
26801  return _wrap_new_IndexPreTransform__SWIG_1(self, args);
26802  }
26803  if (argc == 1) {
26804  int _v;
26805  void *vptr = 0;
26806  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__Index, 0);
26807  _v = SWIG_CheckState(res);
26808  if (_v) {
26809  return _wrap_new_IndexPreTransform__SWIG_0(self, args);
26810  }
26811  }
26812  if (argc == 2) {
26813  int _v;
26814  void *vptr = 0;
26815  int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_faiss__VectorTransform, 0);
26816  _v = SWIG_CheckState(res);
26817  if (_v) {
26818  void *vptr = 0;
26819  int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_faiss__Index, 0);
26820  _v = SWIG_CheckState(res);
26821  if (_v) {
26822  return _wrap_new_IndexPreTransform__SWIG_2(self, args);
26823  }
26824  }
26825  }
26826 
26827 fail:
26828  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IndexPreTransform'.\n"
26829  " Possible C/C++ prototypes are:\n"
26830  " faiss::IndexPreTransform::IndexPreTransform(faiss::Index *)\n"
26831  " faiss::IndexPreTransform::IndexPreTransform()\n"
26832  " faiss::IndexPreTransform::IndexPreTransform(faiss::VectorTransform *,faiss::Index *)\n");
26833  return 0;
26834 }
26835 
26836 
26837 SWIGINTERN PyObject *_wrap_IndexPreTransform_prepend_transform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26838  PyObject *resultobj = 0;
26841  void *argp1 = 0 ;
26842  int res1 = 0 ;
26843  void *argp2 = 0 ;
26844  int res2 = 0 ;
26845  PyObject * obj0 = 0 ;
26846  PyObject * obj1 = 0 ;
26847 
26848  if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_prepend_transform",&obj0,&obj1)) SWIG_fail;
26849  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26850  if (!SWIG_IsOK(res1)) {
26851  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_prepend_transform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26852  }
26853  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26854  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_faiss__VectorTransform, 0 | 0 );
26855  if (!SWIG_IsOK(res2)) {
26856  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_prepend_transform" "', argument " "2"" of type '" "faiss::VectorTransform *""'");
26857  }
26858  arg2 = reinterpret_cast< faiss::VectorTransform * >(argp2);
26859  {
26860  Py_BEGIN_ALLOW_THREADS
26861  try {
26862  (arg1)->prepend_transform(arg2);
26863  } catch(faiss::FaissException & e) {
26864  PyEval_RestoreThread(_save);
26865 
26866  if (PyErr_Occurred()) {
26867  // some previous code already set the error type.
26868  } else {
26869  PyErr_SetString(PyExc_RuntimeError, e.what());
26870  }
26871  SWIG_fail;
26872  }
26873  Py_END_ALLOW_THREADS
26874  }
26875  resultobj = SWIG_Py_Void();
26876  return resultobj;
26877 fail:
26878  return NULL;
26879 }
26880 
26881 
26882 SWIGINTERN PyObject *_wrap_IndexPreTransform_train(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26883  PyObject *resultobj = 0;
26885  faiss::Index::idx_t arg2 ;
26886  float *arg3 = (float *) 0 ;
26887  void *argp1 = 0 ;
26888  int res1 = 0 ;
26889  long val2 ;
26890  int ecode2 = 0 ;
26891  void *argp3 = 0 ;
26892  int res3 = 0 ;
26893  PyObject * obj0 = 0 ;
26894  PyObject * obj1 = 0 ;
26895  PyObject * obj2 = 0 ;
26896 
26897  if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_train",&obj0,&obj1,&obj2)) SWIG_fail;
26898  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26899  if (!SWIG_IsOK(res1)) {
26900  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_train" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26901  }
26902  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26903  ecode2 = SWIG_AsVal_long(obj1, &val2);
26904  if (!SWIG_IsOK(ecode2)) {
26905  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_train" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
26906  }
26907  arg2 = static_cast< faiss::Index::idx_t >(val2);
26908  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26909  if (!SWIG_IsOK(res3)) {
26910  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_train" "', argument " "3"" of type '" "float const *""'");
26911  }
26912  arg3 = reinterpret_cast< float * >(argp3);
26913  {
26914  Py_BEGIN_ALLOW_THREADS
26915  try {
26916  (arg1)->train(arg2,(float const *)arg3);
26917  } catch(faiss::FaissException & e) {
26918  PyEval_RestoreThread(_save);
26919 
26920  if (PyErr_Occurred()) {
26921  // some previous code already set the error type.
26922  } else {
26923  PyErr_SetString(PyExc_RuntimeError, e.what());
26924  }
26925  SWIG_fail;
26926  }
26927  Py_END_ALLOW_THREADS
26928  }
26929  resultobj = SWIG_Py_Void();
26930  return resultobj;
26931 fail:
26932  return NULL;
26933 }
26934 
26935 
26936 SWIGINTERN PyObject *_wrap_IndexPreTransform_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26937  PyObject *resultobj = 0;
26939  faiss::Index::idx_t arg2 ;
26940  float *arg3 = (float *) 0 ;
26941  void *argp1 = 0 ;
26942  int res1 = 0 ;
26943  long val2 ;
26944  int ecode2 = 0 ;
26945  void *argp3 = 0 ;
26946  int res3 = 0 ;
26947  PyObject * obj0 = 0 ;
26948  PyObject * obj1 = 0 ;
26949  PyObject * obj2 = 0 ;
26950 
26951  if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_add",&obj0,&obj1,&obj2)) SWIG_fail;
26952  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
26953  if (!SWIG_IsOK(res1)) {
26954  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
26955  }
26956  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
26957  ecode2 = SWIG_AsVal_long(obj1, &val2);
26958  if (!SWIG_IsOK(ecode2)) {
26959  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
26960  }
26961  arg2 = static_cast< faiss::Index::idx_t >(val2);
26962  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
26963  if (!SWIG_IsOK(res3)) {
26964  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add" "', argument " "3"" of type '" "float const *""'");
26965  }
26966  arg3 = reinterpret_cast< float * >(argp3);
26967  {
26968  Py_BEGIN_ALLOW_THREADS
26969  try {
26970  (arg1)->add(arg2,(float const *)arg3);
26971  } catch(faiss::FaissException & e) {
26972  PyEval_RestoreThread(_save);
26973 
26974  if (PyErr_Occurred()) {
26975  // some previous code already set the error type.
26976  } else {
26977  PyErr_SetString(PyExc_RuntimeError, e.what());
26978  }
26979  SWIG_fail;
26980  }
26981  Py_END_ALLOW_THREADS
26982  }
26983  resultobj = SWIG_Py_Void();
26984  return resultobj;
26985 fail:
26986  return NULL;
26987 }
26988 
26989 
26990 SWIGINTERN PyObject *_wrap_IndexPreTransform_add_with_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26991  PyObject *resultobj = 0;
26993  faiss::Index::idx_t arg2 ;
26994  float *arg3 = (float *) 0 ;
26995  long *arg4 = (long *) 0 ;
26996  void *argp1 = 0 ;
26997  int res1 = 0 ;
26998  long val2 ;
26999  int ecode2 = 0 ;
27000  void *argp3 = 0 ;
27001  int res3 = 0 ;
27002  void *argp4 = 0 ;
27003  int res4 = 0 ;
27004  PyObject * obj0 = 0 ;
27005  PyObject * obj1 = 0 ;
27006  PyObject * obj2 = 0 ;
27007  PyObject * obj3 = 0 ;
27008 
27009  if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_add_with_ids",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
27010  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27011  if (!SWIG_IsOK(res1)) {
27012  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_add_with_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
27013  }
27014  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27015  ecode2 = SWIG_AsVal_long(obj1, &val2);
27016  if (!SWIG_IsOK(ecode2)) {
27017  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_add_with_ids" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27018  }
27019  arg2 = static_cast< faiss::Index::idx_t >(val2);
27020  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27021  if (!SWIG_IsOK(res3)) {
27022  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_add_with_ids" "', argument " "3"" of type '" "float const *""'");
27023  }
27024  arg3 = reinterpret_cast< float * >(argp3);
27025  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_long, 0 | 0 );
27026  if (!SWIG_IsOK(res4)) {
27027  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_add_with_ids" "', argument " "4"" of type '" "long const *""'");
27028  }
27029  arg4 = reinterpret_cast< long * >(argp4);
27030  {
27031  Py_BEGIN_ALLOW_THREADS
27032  try {
27033  (arg1)->add_with_ids(arg2,(float const *)arg3,(long const *)arg4);
27034  } catch(faiss::FaissException & e) {
27035  PyEval_RestoreThread(_save);
27036 
27037  if (PyErr_Occurred()) {
27038  // some previous code already set the error type.
27039  } else {
27040  PyErr_SetString(PyExc_RuntimeError, e.what());
27041  }
27042  SWIG_fail;
27043  }
27044  Py_END_ALLOW_THREADS
27045  }
27046  resultobj = SWIG_Py_Void();
27047  return resultobj;
27048 fail:
27049  return NULL;
27050 }
27051 
27052 
27053 SWIGINTERN PyObject *_wrap_IndexPreTransform_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27054  PyObject *resultobj = 0;
27056  void *argp1 = 0 ;
27057  int res1 = 0 ;
27058  PyObject * obj0 = 0 ;
27059 
27060  if (!PyArg_ParseTuple(args,(char *)"O:IndexPreTransform_reset",&obj0)) SWIG_fail;
27061  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27062  if (!SWIG_IsOK(res1)) {
27063  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reset" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
27064  }
27065  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27066  {
27067  Py_BEGIN_ALLOW_THREADS
27068  try {
27069  (arg1)->reset();
27070  } catch(faiss::FaissException & e) {
27071  PyEval_RestoreThread(_save);
27072 
27073  if (PyErr_Occurred()) {
27074  // some previous code already set the error type.
27075  } else {
27076  PyErr_SetString(PyExc_RuntimeError, e.what());
27077  }
27078  SWIG_fail;
27079  }
27080  Py_END_ALLOW_THREADS
27081  }
27082  resultobj = SWIG_Py_Void();
27083  return resultobj;
27084 fail:
27085  return NULL;
27086 }
27087 
27088 
27089 SWIGINTERN PyObject *_wrap_IndexPreTransform_remove_ids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27090  PyObject *resultobj = 0;
27092  faiss::IDSelector *arg2 = 0 ;
27093  void *argp1 = 0 ;
27094  int res1 = 0 ;
27095  void *argp2 = 0 ;
27096  int res2 = 0 ;
27097  PyObject * obj0 = 0 ;
27098  PyObject * obj1 = 0 ;
27099  long result;
27100 
27101  if (!PyArg_ParseTuple(args,(char *)"OO:IndexPreTransform_remove_ids",&obj0,&obj1)) SWIG_fail;
27102  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27103  if (!SWIG_IsOK(res1)) {
27104  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_remove_ids" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
27105  }
27106  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27107  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_faiss__IDSelector, 0 | 0);
27108  if (!SWIG_IsOK(res2)) {
27109  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'");
27110  }
27111  if (!argp2) {
27112  SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IndexPreTransform_remove_ids" "', argument " "2"" of type '" "faiss::IDSelector const &""'");
27113  }
27114  arg2 = reinterpret_cast< faiss::IDSelector * >(argp2);
27115  {
27116  Py_BEGIN_ALLOW_THREADS
27117  try {
27118  result = (long)(arg1)->remove_ids((faiss::IDSelector const &)*arg2);
27119  } catch(faiss::FaissException & e) {
27120  PyEval_RestoreThread(_save);
27121 
27122  if (PyErr_Occurred()) {
27123  // some previous code already set the error type.
27124  } else {
27125  PyErr_SetString(PyExc_RuntimeError, e.what());
27126  }
27127  SWIG_fail;
27128  }
27129  Py_END_ALLOW_THREADS
27130  }
27131  resultobj = SWIG_From_long(static_cast< long >(result));
27132  return resultobj;
27133 fail:
27134  return NULL;
27135 }
27136 
27137 
27138 SWIGINTERN PyObject *_wrap_IndexPreTransform_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27139  PyObject *resultobj = 0;
27141  faiss::Index::idx_t arg2 ;
27142  float *arg3 = (float *) 0 ;
27143  faiss::Index::idx_t arg4 ;
27144  float *arg5 = (float *) 0 ;
27146  void *argp1 = 0 ;
27147  int res1 = 0 ;
27148  long val2 ;
27149  int ecode2 = 0 ;
27150  void *argp3 = 0 ;
27151  int res3 = 0 ;
27152  long val4 ;
27153  int ecode4 = 0 ;
27154  void *argp5 = 0 ;
27155  int res5 = 0 ;
27156  void *argp6 = 0 ;
27157  int res6 = 0 ;
27158  PyObject * obj0 = 0 ;
27159  PyObject * obj1 = 0 ;
27160  PyObject * obj2 = 0 ;
27161  PyObject * obj3 = 0 ;
27162  PyObject * obj4 = 0 ;
27163  PyObject * obj5 = 0 ;
27164 
27165  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexPreTransform_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
27166  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27167  if (!SWIG_IsOK(res1)) {
27168  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27169  }
27170  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27171  ecode2 = SWIG_AsVal_long(obj1, &val2);
27172  if (!SWIG_IsOK(ecode2)) {
27173  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27174  }
27175  arg2 = static_cast< faiss::Index::idx_t >(val2);
27176  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27177  if (!SWIG_IsOK(res3)) {
27178  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search" "', argument " "3"" of type '" "float const *""'");
27179  }
27180  arg3 = reinterpret_cast< float * >(argp3);
27181  ecode4 = SWIG_AsVal_long(obj3, &val4);
27182  if (!SWIG_IsOK(ecode4)) {
27183  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
27184  }
27185  arg4 = static_cast< faiss::Index::idx_t >(val4);
27186  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
27187  if (!SWIG_IsOK(res5)) {
27188  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search" "', argument " "5"" of type '" "float *""'");
27189  }
27190  arg5 = reinterpret_cast< float * >(argp5);
27191  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 );
27192  if (!SWIG_IsOK(res6)) {
27193  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'");
27194  }
27195  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
27196  {
27197  Py_BEGIN_ALLOW_THREADS
27198  try {
27199  ((faiss::IndexPreTransform const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
27200  } catch(faiss::FaissException & e) {
27201  PyEval_RestoreThread(_save);
27202 
27203  if (PyErr_Occurred()) {
27204  // some previous code already set the error type.
27205  } else {
27206  PyErr_SetString(PyExc_RuntimeError, e.what());
27207  }
27208  SWIG_fail;
27209  }
27210  Py_END_ALLOW_THREADS
27211  }
27212  resultobj = SWIG_Py_Void();
27213  return resultobj;
27214 fail:
27215  return NULL;
27216 }
27217 
27218 
27219 SWIGINTERN PyObject *_wrap_IndexPreTransform_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27220  PyObject *resultobj = 0;
27222  faiss::Index::idx_t arg2 ;
27223  float *arg3 = (float *) 0 ;
27224  float arg4 ;
27226  void *argp1 = 0 ;
27227  int res1 = 0 ;
27228  long val2 ;
27229  int ecode2 = 0 ;
27230  void *argp3 = 0 ;
27231  int res3 = 0 ;
27232  float val4 ;
27233  int ecode4 = 0 ;
27234  void *argp5 = 0 ;
27235  int res5 = 0 ;
27236  PyObject * obj0 = 0 ;
27237  PyObject * obj1 = 0 ;
27238  PyObject * obj2 = 0 ;
27239  PyObject * obj3 = 0 ;
27240  PyObject * obj4 = 0 ;
27241 
27242  if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexPreTransform_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
27243  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27244  if (!SWIG_IsOK(res1)) {
27245  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_range_search" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27246  }
27247  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27248  ecode2 = SWIG_AsVal_long(obj1, &val2);
27249  if (!SWIG_IsOK(ecode2)) {
27250  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27251  }
27252  arg2 = static_cast< faiss::Index::idx_t >(val2);
27253  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27254  if (!SWIG_IsOK(res3)) {
27255  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_range_search" "', argument " "3"" of type '" "float const *""'");
27256  }
27257  arg3 = reinterpret_cast< float * >(argp3);
27258  ecode4 = SWIG_AsVal_float(obj3, &val4);
27259  if (!SWIG_IsOK(ecode4)) {
27260  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_range_search" "', argument " "4"" of type '" "float""'");
27261  }
27262  arg4 = static_cast< float >(val4);
27263  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 );
27264  if (!SWIG_IsOK(res5)) {
27265  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'");
27266  }
27267  arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5);
27268  {
27269  Py_BEGIN_ALLOW_THREADS
27270  try {
27271  ((faiss::IndexPreTransform const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5);
27272  } catch(faiss::FaissException & e) {
27273  PyEval_RestoreThread(_save);
27274 
27275  if (PyErr_Occurred()) {
27276  // some previous code already set the error type.
27277  } else {
27278  PyErr_SetString(PyExc_RuntimeError, e.what());
27279  }
27280  SWIG_fail;
27281  }
27282  Py_END_ALLOW_THREADS
27283  }
27284  resultobj = SWIG_Py_Void();
27285  return resultobj;
27286 fail:
27287  return NULL;
27288 }
27289 
27290 
27291 SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27292  PyObject *resultobj = 0;
27294  faiss::Index::idx_t arg2 ;
27295  float *arg3 = (float *) 0 ;
27296  void *argp1 = 0 ;
27297  int res1 = 0 ;
27298  long val2 ;
27299  int ecode2 = 0 ;
27300  void *argp3 = 0 ;
27301  int res3 = 0 ;
27302  PyObject * obj0 = 0 ;
27303  PyObject * obj1 = 0 ;
27304  PyObject * obj2 = 0 ;
27305 
27306  if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_reconstruct",&obj0,&obj1,&obj2)) SWIG_fail;
27307  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27308  if (!SWIG_IsOK(res1)) {
27309  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27310  }
27311  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27312  ecode2 = SWIG_AsVal_long(obj1, &val2);
27313  if (!SWIG_IsOK(ecode2)) {
27314  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27315  }
27316  arg2 = static_cast< faiss::Index::idx_t >(val2);
27317  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27318  if (!SWIG_IsOK(res3)) {
27319  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reconstruct" "', argument " "3"" of type '" "float *""'");
27320  }
27321  arg3 = reinterpret_cast< float * >(argp3);
27322  {
27323  Py_BEGIN_ALLOW_THREADS
27324  try {
27325  ((faiss::IndexPreTransform const *)arg1)->reconstruct(arg2,arg3);
27326  } catch(faiss::FaissException & e) {
27327  PyEval_RestoreThread(_save);
27328 
27329  if (PyErr_Occurred()) {
27330  // some previous code already set the error type.
27331  } else {
27332  PyErr_SetString(PyExc_RuntimeError, e.what());
27333  }
27334  SWIG_fail;
27335  }
27336  Py_END_ALLOW_THREADS
27337  }
27338  resultobj = SWIG_Py_Void();
27339  return resultobj;
27340 fail:
27341  return NULL;
27342 }
27343 
27344 
27345 SWIGINTERN PyObject *_wrap_IndexPreTransform_reconstruct_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27346  PyObject *resultobj = 0;
27348  faiss::Index::idx_t arg2 ;
27349  faiss::Index::idx_t arg3 ;
27350  float *arg4 = (float *) 0 ;
27351  void *argp1 = 0 ;
27352  int res1 = 0 ;
27353  long val2 ;
27354  int ecode2 = 0 ;
27355  long val3 ;
27356  int ecode3 = 0 ;
27357  void *argp4 = 0 ;
27358  int res4 = 0 ;
27359  PyObject * obj0 = 0 ;
27360  PyObject * obj1 = 0 ;
27361  PyObject * obj2 = 0 ;
27362  PyObject * obj3 = 0 ;
27363 
27364  if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reconstruct_n",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
27365  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27366  if (!SWIG_IsOK(res1)) {
27367  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27368  }
27369  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27370  ecode2 = SWIG_AsVal_long(obj1, &val2);
27371  if (!SWIG_IsOK(ecode2)) {
27372  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27373  }
27374  arg2 = static_cast< faiss::Index::idx_t >(val2);
27375  ecode3 = SWIG_AsVal_long(obj2, &val3);
27376  if (!SWIG_IsOK(ecode3)) {
27377  SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "3"" of type '" "faiss::Index::idx_t""'");
27378  }
27379  arg3 = static_cast< faiss::Index::idx_t >(val3);
27380  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
27381  if (!SWIG_IsOK(res4)) {
27382  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reconstruct_n" "', argument " "4"" of type '" "float *""'");
27383  }
27384  arg4 = reinterpret_cast< float * >(argp4);
27385  {
27386  Py_BEGIN_ALLOW_THREADS
27387  try {
27388  ((faiss::IndexPreTransform const *)arg1)->reconstruct_n(arg2,arg3,arg4);
27389  } catch(faiss::FaissException & e) {
27390  PyEval_RestoreThread(_save);
27391 
27392  if (PyErr_Occurred()) {
27393  // some previous code already set the error type.
27394  } else {
27395  PyErr_SetString(PyExc_RuntimeError, e.what());
27396  }
27397  SWIG_fail;
27398  }
27399  Py_END_ALLOW_THREADS
27400  }
27401  resultobj = SWIG_Py_Void();
27402  return resultobj;
27403 fail:
27404  return NULL;
27405 }
27406 
27407 
27408 SWIGINTERN PyObject *_wrap_IndexPreTransform_search_and_reconstruct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27409  PyObject *resultobj = 0;
27411  faiss::Index::idx_t arg2 ;
27412  float *arg3 = (float *) 0 ;
27413  faiss::Index::idx_t arg4 ;
27414  float *arg5 = (float *) 0 ;
27416  float *arg7 = (float *) 0 ;
27417  void *argp1 = 0 ;
27418  int res1 = 0 ;
27419  long val2 ;
27420  int ecode2 = 0 ;
27421  void *argp3 = 0 ;
27422  int res3 = 0 ;
27423  long val4 ;
27424  int ecode4 = 0 ;
27425  void *argp5 = 0 ;
27426  int res5 = 0 ;
27427  void *argp6 = 0 ;
27428  int res6 = 0 ;
27429  void *argp7 = 0 ;
27430  int res7 = 0 ;
27431  PyObject * obj0 = 0 ;
27432  PyObject * obj1 = 0 ;
27433  PyObject * obj2 = 0 ;
27434  PyObject * obj3 = 0 ;
27435  PyObject * obj4 = 0 ;
27436  PyObject * obj5 = 0 ;
27437  PyObject * obj6 = 0 ;
27438 
27439  if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:IndexPreTransform_search_and_reconstruct",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
27440  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27441  if (!SWIG_IsOK(res1)) {
27442  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27443  }
27444  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27445  ecode2 = SWIG_AsVal_long(obj1, &val2);
27446  if (!SWIG_IsOK(ecode2)) {
27447  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27448  }
27449  arg2 = static_cast< faiss::Index::idx_t >(val2);
27450  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27451  if (!SWIG_IsOK(res3)) {
27452  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "3"" of type '" "float const *""'");
27453  }
27454  arg3 = reinterpret_cast< float * >(argp3);
27455  ecode4 = SWIG_AsVal_long(obj3, &val4);
27456  if (!SWIG_IsOK(ecode4)) {
27457  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
27458  }
27459  arg4 = static_cast< faiss::Index::idx_t >(val4);
27460  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
27461  if (!SWIG_IsOK(res5)) {
27462  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "5"" of type '" "float *""'");
27463  }
27464  arg5 = reinterpret_cast< float * >(argp5);
27465  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 );
27466  if (!SWIG_IsOK(res6)) {
27467  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "6"" of type '" "faiss::Index::idx_t *""'");
27468  }
27469  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
27470  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 );
27471  if (!SWIG_IsOK(res7)) {
27472  SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "IndexPreTransform_search_and_reconstruct" "', argument " "7"" of type '" "float *""'");
27473  }
27474  arg7 = reinterpret_cast< float * >(argp7);
27475  {
27476  Py_BEGIN_ALLOW_THREADS
27477  try {
27478  ((faiss::IndexPreTransform const *)arg1)->search_and_reconstruct(arg2,(float const *)arg3,arg4,arg5,arg6,arg7);
27479  } catch(faiss::FaissException & e) {
27480  PyEval_RestoreThread(_save);
27481 
27482  if (PyErr_Occurred()) {
27483  // some previous code already set the error type.
27484  } else {
27485  PyErr_SetString(PyExc_RuntimeError, e.what());
27486  }
27487  SWIG_fail;
27488  }
27489  Py_END_ALLOW_THREADS
27490  }
27491  resultobj = SWIG_Py_Void();
27492  return resultobj;
27493 fail:
27494  return NULL;
27495 }
27496 
27497 
27498 SWIGINTERN PyObject *_wrap_IndexPreTransform_apply_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27499  PyObject *resultobj = 0;
27501  faiss::Index::idx_t arg2 ;
27502  float *arg3 = (float *) 0 ;
27503  void *argp1 = 0 ;
27504  int res1 = 0 ;
27505  long val2 ;
27506  int ecode2 = 0 ;
27507  void *argp3 = 0 ;
27508  int res3 = 0 ;
27509  PyObject * obj0 = 0 ;
27510  PyObject * obj1 = 0 ;
27511  PyObject * obj2 = 0 ;
27512  float *result = 0 ;
27513 
27514  if (!PyArg_ParseTuple(args,(char *)"OOO:IndexPreTransform_apply_chain",&obj0,&obj1,&obj2)) SWIG_fail;
27515  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27516  if (!SWIG_IsOK(res1)) {
27517  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_apply_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27518  }
27519  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27520  ecode2 = SWIG_AsVal_long(obj1, &val2);
27521  if (!SWIG_IsOK(ecode2)) {
27522  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_apply_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27523  }
27524  arg2 = static_cast< faiss::Index::idx_t >(val2);
27525  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27526  if (!SWIG_IsOK(res3)) {
27527  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_apply_chain" "', argument " "3"" of type '" "float const *""'");
27528  }
27529  arg3 = reinterpret_cast< float * >(argp3);
27530  {
27531  Py_BEGIN_ALLOW_THREADS
27532  try {
27533  result = (float *)((faiss::IndexPreTransform const *)arg1)->apply_chain(arg2,(float const *)arg3);
27534  } catch(faiss::FaissException & e) {
27535  PyEval_RestoreThread(_save);
27536 
27537  if (PyErr_Occurred()) {
27538  // some previous code already set the error type.
27539  } else {
27540  PyErr_SetString(PyExc_RuntimeError, e.what());
27541  }
27542  SWIG_fail;
27543  }
27544  Py_END_ALLOW_THREADS
27545  }
27546  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_float, 0 | 0 );
27547  return resultobj;
27548 fail:
27549  return NULL;
27550 }
27551 
27552 
27553 SWIGINTERN PyObject *_wrap_IndexPreTransform_reverse_chain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27554  PyObject *resultobj = 0;
27556  faiss::Index::idx_t arg2 ;
27557  float *arg3 = (float *) 0 ;
27558  float *arg4 = (float *) 0 ;
27559  void *argp1 = 0 ;
27560  int res1 = 0 ;
27561  long val2 ;
27562  int ecode2 = 0 ;
27563  void *argp3 = 0 ;
27564  int res3 = 0 ;
27565  void *argp4 = 0 ;
27566  int res4 = 0 ;
27567  PyObject * obj0 = 0 ;
27568  PyObject * obj1 = 0 ;
27569  PyObject * obj2 = 0 ;
27570  PyObject * obj3 = 0 ;
27571 
27572  if (!PyArg_ParseTuple(args,(char *)"OOOO:IndexPreTransform_reverse_chain",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
27573  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, 0 | 0 );
27574  if (!SWIG_IsOK(res1)) {
27575  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexPreTransform_reverse_chain" "', argument " "1"" of type '" "faiss::IndexPreTransform const *""'");
27576  }
27577  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27578  ecode2 = SWIG_AsVal_long(obj1, &val2);
27579  if (!SWIG_IsOK(ecode2)) {
27580  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexPreTransform_reverse_chain" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27581  }
27582  arg2 = static_cast< faiss::Index::idx_t >(val2);
27583  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27584  if (!SWIG_IsOK(res3)) {
27585  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexPreTransform_reverse_chain" "', argument " "3"" of type '" "float const *""'");
27586  }
27587  arg3 = reinterpret_cast< float * >(argp3);
27588  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 );
27589  if (!SWIG_IsOK(res4)) {
27590  SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IndexPreTransform_reverse_chain" "', argument " "4"" of type '" "float *""'");
27591  }
27592  arg4 = reinterpret_cast< float * >(argp4);
27593  {
27594  Py_BEGIN_ALLOW_THREADS
27595  try {
27596  ((faiss::IndexPreTransform const *)arg1)->reverse_chain(arg2,(float const *)arg3,arg4);
27597  } catch(faiss::FaissException & e) {
27598  PyEval_RestoreThread(_save);
27599 
27600  if (PyErr_Occurred()) {
27601  // some previous code already set the error type.
27602  } else {
27603  PyErr_SetString(PyExc_RuntimeError, e.what());
27604  }
27605  SWIG_fail;
27606  }
27607  Py_END_ALLOW_THREADS
27608  }
27609  resultobj = SWIG_Py_Void();
27610  return resultobj;
27611 fail:
27612  return NULL;
27613 }
27614 
27615 
27616 SWIGINTERN PyObject *_wrap_delete_IndexPreTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27617  PyObject *resultobj = 0;
27619  void *argp1 = 0 ;
27620  int res1 = 0 ;
27621  PyObject * obj0 = 0 ;
27622 
27623  if (!PyArg_ParseTuple(args,(char *)"O:delete_IndexPreTransform",&obj0)) SWIG_fail;
27624  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexPreTransform, SWIG_POINTER_DISOWN | 0 );
27625  if (!SWIG_IsOK(res1)) {
27626  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IndexPreTransform" "', argument " "1"" of type '" "faiss::IndexPreTransform *""'");
27627  }
27628  arg1 = reinterpret_cast< faiss::IndexPreTransform * >(argp1);
27629  {
27630  Py_BEGIN_ALLOW_THREADS
27631  try {
27632  delete arg1;
27633  } catch(faiss::FaissException & e) {
27634  PyEval_RestoreThread(_save);
27635 
27636  if (PyErr_Occurred()) {
27637  // some previous code already set the error type.
27638  } else {
27639  PyErr_SetString(PyExc_RuntimeError, e.what());
27640  }
27641  SWIG_fail;
27642  }
27643  Py_END_ALLOW_THREADS
27644  }
27645  resultobj = SWIG_Py_Void();
27646  return resultobj;
27647 fail:
27648  return NULL;
27649 }
27650 
27651 
27652 SWIGINTERN PyObject *IndexPreTransform_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27653  PyObject *obj;
27654  if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
27655  SWIG_TypeNewClientData(SWIGTYPE_p_faiss__IndexPreTransform, SWIG_NewClientData(obj));
27656  return SWIG_Py_Void();
27657 }
27658 
27659 SWIGINTERN PyObject *_wrap_IndexFlat_xb_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27660  PyObject *resultobj = 0;
27661  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27662  std::vector< float > *arg2 = (std::vector< float > *) 0 ;
27663  void *argp1 = 0 ;
27664  int res1 = 0 ;
27665  void *argp2 = 0 ;
27666  int res2 = 0 ;
27667  PyObject * obj0 = 0 ;
27668  PyObject * obj1 = 0 ;
27669 
27670  if (!PyArg_ParseTuple(args,(char *)"OO:IndexFlat_xb_set",&obj0,&obj1)) SWIG_fail;
27671  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27672  if (!SWIG_IsOK(res1)) {
27673  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_set" "', argument " "1"" of type '" "faiss::IndexFlat *""'");
27674  }
27675  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27676  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
27677  if (!SWIG_IsOK(res2)) {
27678  SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IndexFlat_xb_set" "', argument " "2"" of type '" "std::vector< float > *""'");
27679  }
27680  arg2 = reinterpret_cast< std::vector< float > * >(argp2);
27681  if (arg1) (arg1)->xb = *arg2;
27682  resultobj = SWIG_Py_Void();
27683  return resultobj;
27684 fail:
27685  return NULL;
27686 }
27687 
27688 
27689 SWIGINTERN PyObject *_wrap_IndexFlat_xb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27690  PyObject *resultobj = 0;
27691  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27692  void *argp1 = 0 ;
27693  int res1 = 0 ;
27694  PyObject * obj0 = 0 ;
27695  std::vector< float > *result = 0 ;
27696 
27697  if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_xb_get",&obj0)) SWIG_fail;
27698  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27699  if (!SWIG_IsOK(res1)) {
27700  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_xb_get" "', argument " "1"" of type '" "faiss::IndexFlat *""'");
27701  }
27702  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27703  result = (std::vector< float > *)& ((arg1)->xb);
27704  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_float_t, 0 | 0 );
27705  return resultobj;
27706 fail:
27707  return NULL;
27708 }
27709 
27710 
27711 SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27712  PyObject *resultobj = 0;
27713  faiss::Index::idx_t arg1 ;
27714  faiss::MetricType arg2 ;
27715  long val1 ;
27716  int ecode1 = 0 ;
27717  int val2 ;
27718  int ecode2 = 0 ;
27719  PyObject * obj0 = 0 ;
27720  PyObject * obj1 = 0 ;
27721  faiss::IndexFlat *result = 0 ;
27722 
27723  if (!PyArg_ParseTuple(args,(char *)"OO:new_IndexFlat",&obj0,&obj1)) SWIG_fail;
27724  ecode1 = SWIG_AsVal_long(obj0, &val1);
27725  if (!SWIG_IsOK(ecode1)) {
27726  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'");
27727  }
27728  arg1 = static_cast< faiss::Index::idx_t >(val1);
27729  ecode2 = SWIG_AsVal_int(obj1, &val2);
27730  if (!SWIG_IsOK(ecode2)) {
27731  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IndexFlat" "', argument " "2"" of type '" "faiss::MetricType""'");
27732  }
27733  arg2 = static_cast< faiss::MetricType >(val2);
27734  {
27735  Py_BEGIN_ALLOW_THREADS
27736  try {
27737  result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1,arg2);
27738  } catch(faiss::FaissException & e) {
27739  PyEval_RestoreThread(_save);
27740 
27741  if (PyErr_Occurred()) {
27742  // some previous code already set the error type.
27743  } else {
27744  PyErr_SetString(PyExc_RuntimeError, e.what());
27745  }
27746  SWIG_fail;
27747  }
27748  Py_END_ALLOW_THREADS
27749  }
27750  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 );
27751  return resultobj;
27752 fail:
27753  return NULL;
27754 }
27755 
27756 
27757 SWIGINTERN PyObject *_wrap_new_IndexFlat__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27758  PyObject *resultobj = 0;
27759  faiss::Index::idx_t arg1 ;
27760  long val1 ;
27761  int ecode1 = 0 ;
27762  PyObject * obj0 = 0 ;
27763  faiss::IndexFlat *result = 0 ;
27764 
27765  if (!PyArg_ParseTuple(args,(char *)"O:new_IndexFlat",&obj0)) SWIG_fail;
27766  ecode1 = SWIG_AsVal_long(obj0, &val1);
27767  if (!SWIG_IsOK(ecode1)) {
27768  SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IndexFlat" "', argument " "1"" of type '" "faiss::Index::idx_t""'");
27769  }
27770  arg1 = static_cast< faiss::Index::idx_t >(val1);
27771  {
27772  Py_BEGIN_ALLOW_THREADS
27773  try {
27774  result = (faiss::IndexFlat *)new faiss::IndexFlat(arg1);
27775  } catch(faiss::FaissException & e) {
27776  PyEval_RestoreThread(_save);
27777 
27778  if (PyErr_Occurred()) {
27779  // some previous code already set the error type.
27780  } else {
27781  PyErr_SetString(PyExc_RuntimeError, e.what());
27782  }
27783  SWIG_fail;
27784  }
27785  Py_END_ALLOW_THREADS
27786  }
27787  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_faiss__IndexFlat, SWIG_POINTER_NEW | 0 );
27788  return resultobj;
27789 fail:
27790  return NULL;
27791 }
27792 
27793 
27794 SWIGINTERN PyObject *_wrap_IndexFlat_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27795  PyObject *resultobj = 0;
27796  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27797  faiss::Index::idx_t arg2 ;
27798  float *arg3 = (float *) 0 ;
27799  void *argp1 = 0 ;
27800  int res1 = 0 ;
27801  long val2 ;
27802  int ecode2 = 0 ;
27803  void *argp3 = 0 ;
27804  int res3 = 0 ;
27805  PyObject * obj0 = 0 ;
27806  PyObject * obj1 = 0 ;
27807  PyObject * obj2 = 0 ;
27808 
27809  if (!PyArg_ParseTuple(args,(char *)"OOO:IndexFlat_add",&obj0,&obj1,&obj2)) SWIG_fail;
27810  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27811  if (!SWIG_IsOK(res1)) {
27812  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_add" "', argument " "1"" of type '" "faiss::IndexFlat *""'");
27813  }
27814  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27815  ecode2 = SWIG_AsVal_long(obj1, &val2);
27816  if (!SWIG_IsOK(ecode2)) {
27817  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_add" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27818  }
27819  arg2 = static_cast< faiss::Index::idx_t >(val2);
27820  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27821  if (!SWIG_IsOK(res3)) {
27822  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_add" "', argument " "3"" of type '" "float const *""'");
27823  }
27824  arg3 = reinterpret_cast< float * >(argp3);
27825  {
27826  Py_BEGIN_ALLOW_THREADS
27827  try {
27828  (arg1)->add(arg2,(float const *)arg3);
27829  } catch(faiss::FaissException & e) {
27830  PyEval_RestoreThread(_save);
27831 
27832  if (PyErr_Occurred()) {
27833  // some previous code already set the error type.
27834  } else {
27835  PyErr_SetString(PyExc_RuntimeError, e.what());
27836  }
27837  SWIG_fail;
27838  }
27839  Py_END_ALLOW_THREADS
27840  }
27841  resultobj = SWIG_Py_Void();
27842  return resultobj;
27843 fail:
27844  return NULL;
27845 }
27846 
27847 
27848 SWIGINTERN PyObject *_wrap_IndexFlat_reset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27849  PyObject *resultobj = 0;
27850  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27851  void *argp1 = 0 ;
27852  int res1 = 0 ;
27853  PyObject * obj0 = 0 ;
27854 
27855  if (!PyArg_ParseTuple(args,(char *)"O:IndexFlat_reset",&obj0)) SWIG_fail;
27856  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27857  if (!SWIG_IsOK(res1)) {
27858  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_reset" "', argument " "1"" of type '" "faiss::IndexFlat *""'");
27859  }
27860  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27861  {
27862  Py_BEGIN_ALLOW_THREADS
27863  try {
27864  (arg1)->reset();
27865  } catch(faiss::FaissException & e) {
27866  PyEval_RestoreThread(_save);
27867 
27868  if (PyErr_Occurred()) {
27869  // some previous code already set the error type.
27870  } else {
27871  PyErr_SetString(PyExc_RuntimeError, e.what());
27872  }
27873  SWIG_fail;
27874  }
27875  Py_END_ALLOW_THREADS
27876  }
27877  resultobj = SWIG_Py_Void();
27878  return resultobj;
27879 fail:
27880  return NULL;
27881 }
27882 
27883 
27884 SWIGINTERN PyObject *_wrap_IndexFlat_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27885  PyObject *resultobj = 0;
27886  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27887  faiss::Index::idx_t arg2 ;
27888  float *arg3 = (float *) 0 ;
27889  faiss::Index::idx_t arg4 ;
27890  float *arg5 = (float *) 0 ;
27892  void *argp1 = 0 ;
27893  int res1 = 0 ;
27894  long val2 ;
27895  int ecode2 = 0 ;
27896  void *argp3 = 0 ;
27897  int res3 = 0 ;
27898  long val4 ;
27899  int ecode4 = 0 ;
27900  void *argp5 = 0 ;
27901  int res5 = 0 ;
27902  void *argp6 = 0 ;
27903  int res6 = 0 ;
27904  PyObject * obj0 = 0 ;
27905  PyObject * obj1 = 0 ;
27906  PyObject * obj2 = 0 ;
27907  PyObject * obj3 = 0 ;
27908  PyObject * obj4 = 0 ;
27909  PyObject * obj5 = 0 ;
27910 
27911  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:IndexFlat_search",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
27912  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27913  if (!SWIG_IsOK(res1)) {
27914  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'");
27915  }
27916  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27917  ecode2 = SWIG_AsVal_long(obj1, &val2);
27918  if (!SWIG_IsOK(ecode2)) {
27919  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27920  }
27921  arg2 = static_cast< faiss::Index::idx_t >(val2);
27922  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
27923  if (!SWIG_IsOK(res3)) {
27924  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_search" "', argument " "3"" of type '" "float const *""'");
27925  }
27926  arg3 = reinterpret_cast< float * >(argp3);
27927  ecode4 = SWIG_AsVal_long(obj3, &val4);
27928  if (!SWIG_IsOK(ecode4)) {
27929  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_search" "', argument " "4"" of type '" "faiss::Index::idx_t""'");
27930  }
27931  arg4 = static_cast< faiss::Index::idx_t >(val4);
27932  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 );
27933  if (!SWIG_IsOK(res5)) {
27934  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_search" "', argument " "5"" of type '" "float *""'");
27935  }
27936  arg5 = reinterpret_cast< float * >(argp5);
27937  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_long, 0 | 0 );
27938  if (!SWIG_IsOK(res6)) {
27939  SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "IndexFlat_search" "', argument " "6"" of type '" "faiss::Index::idx_t *""'");
27940  }
27941  arg6 = reinterpret_cast< faiss::Index::idx_t * >(argp6);
27942  {
27943  Py_BEGIN_ALLOW_THREADS
27944  try {
27945  ((faiss::IndexFlat const *)arg1)->search(arg2,(float const *)arg3,arg4,arg5,arg6);
27946  } catch(faiss::FaissException & e) {
27947  PyEval_RestoreThread(_save);
27948 
27949  if (PyErr_Occurred()) {
27950  // some previous code already set the error type.
27951  } else {
27952  PyErr_SetString(PyExc_RuntimeError, e.what());
27953  }
27954  SWIG_fail;
27955  }
27956  Py_END_ALLOW_THREADS
27957  }
27958  resultobj = SWIG_Py_Void();
27959  return resultobj;
27960 fail:
27961  return NULL;
27962 }
27963 
27964 
27965 SWIGINTERN PyObject *_wrap_IndexFlat_range_search(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27966  PyObject *resultobj = 0;
27967  faiss::IndexFlat *arg1 = (faiss::IndexFlat *) 0 ;
27968  faiss::Index::idx_t arg2 ;
27969  float *arg3 = (float *) 0 ;
27970  float arg4 ;
27972  void *argp1 = 0 ;
27973  int res1 = 0 ;
27974  long val2 ;
27975  int ecode2 = 0 ;
27976  void *argp3 = 0 ;
27977  int res3 = 0 ;
27978  float val4 ;
27979  int ecode4 = 0 ;
27980  void *argp5 = 0 ;
27981  int res5 = 0 ;
27982  PyObject * obj0 = 0 ;
27983  PyObject * obj1 = 0 ;
27984  PyObject * obj2 = 0 ;
27985  PyObject * obj3 = 0 ;
27986  PyObject * obj4 = 0 ;
27987 
27988  if (!PyArg_ParseTuple(args,(char *)"OOOOO:IndexFlat_range_search",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
27989  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_faiss__IndexFlat, 0 | 0 );
27990  if (!SWIG_IsOK(res1)) {
27991  SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IndexFlat_range_search" "', argument " "1"" of type '" "faiss::IndexFlat const *""'");
27992  }
27993  arg1 = reinterpret_cast< faiss::IndexFlat * >(argp1);
27994  ecode2 = SWIG_AsVal_long(obj1, &val2);
27995  if (!SWIG_IsOK(ecode2)) {
27996  SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IndexFlat_range_search" "', argument " "2"" of type '" "faiss::Index::idx_t""'");
27997  }
27998  arg2 = static_cast< faiss::Index::idx_t >(val2);
27999  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 );
28000  if (!SWIG_IsOK(res3)) {
28001  SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IndexFlat_range_search" "', argument " "3"" of type '" "float const *""'");
28002  }
28003  arg3 = reinterpret_cast< float * >(argp3);
28004  ecode4 = SWIG_AsVal_float(obj3, &val4);
28005  if (!SWIG_IsOK(ecode4)) {
28006  SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IndexFlat_range_search" "', argument " "4"" of type '" "float""'");
28007  }
28008  arg4 = static_cast< float >(val4);
28009  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_faiss__RangeSearchResult, 0 | 0 );
28010  if (!SWIG_IsOK(res5)) {
28011  SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "IndexFlat_range_search" "', argument " "5"" of type '" "faiss::RangeSearchResult *""'");
28012  }
28013  arg5 = reinterpret_cast< faiss::RangeSearchResult * >(argp5);
28014  {
28015  Py_BEGIN_ALLOW_THREADS
28016  try {
28017  ((faiss::IndexFlat const *)arg1)->range_search(arg2,(float const *)arg3,arg4,arg5);
28018  } catch(faiss::FaissException & e) {
28019  PyEval_RestoreThread(_save);
28020 
28021  if (PyErr_Occurred()) {
28022  // some previous code already set the error type.
28023  } else {
28024  PyErr_SetString(